#000092

IT

"I" and "Ti" are aliens with a space ship that works on "planetar" enegry - it obtains fuel by "eating" a planet that is on the ships trajectory. The trajectory of the ship is a 2D straight line, and the ships starts its trip from the coordinates (0,0). Since we know the coordinates of all the planets, we would like to know how many of the planets can the ship "eat" on its way.


InputFrom the first line of the standard input read two integers m and b, that represent the trajectory of the ship. The ship travels along the line y = mx + b (starting from (0,0). From the next line read one integer n (1 <= n <= 10^6), That represent the number of planets. From each of the next n lines read two real numbers pi and qi, that represent the coordinates of the i-th planet. Assume that the ship started its travel at the point where x = 0, and is moving towards positive values of x.

OutputTo the standard output, output one number that represents the number of planets that the ship can "eat" on its trajectory.

Input:2.0 3.0
9
-4.0 -5.0
0.0 3.0
0.0 0.0
7.0 17.0
10.4 24.0
4.2 11.4
5.5 14.0
2.8 8.6
-1.0 1.0


Output:
5
Explanation:
The ship will eat the planets 2, 4, 6, 7 and 8.

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.