On the number of integral points on algebraic curves