Captain Latvia

No attempts yetTime limit1sMemory limit1024 MB

Statement

Consider an infinitely long corridor drawn in the plane. Its floor (the bottom wall) is the segment from (0,0)(0, 0) to (L,0)(L, 0). Its two side walls are the rays that start at (0,0)(0, 0) and (L,0)(L, 0) and extend upward (in the direction of increasing yy). Thus the corridor is the set of all points with 0xL0 \le x \le L and y0y \ge 0.

There are NN enemies in the corridor. The ii-th enemy stands at the point (xi,yi)(x_i, y_i), where 0<xi<L0 < x_i < L and yi>0y_i > 0.

The hero stands at the point (X,0)(X, 0) on the floor, where 0<X<L0 < X < L, and throws a shield without moving. The shield flies in a straight line to a point on one side wall, bounces to a point on the other side wall, and then flies straight back to the hero. Its trajectory is therefore a triangle whose three vertices are the hero's position (X,0)(X, 0), a point on the left wall, and a point on the right wall. Every enemy that lies on the boundary of this triangle (on any of its three edges) is knocked out.

The hero may aim freely: the two wall vertices may be placed anywhere on the walls, at any height 0\ge 0. Find the maximum number of enemies that can be knocked out with a single throw.

Input

The first line contains two integers LL and NN — the length of the floor and the number of enemies. The second line contains one integer XX — the hero's xx-coordinate. Each of the next NN lines contains two space-separated integers xix_i and yiy_i — the coordinates of the ii-th enemy.

Output

Print one integer — the maximum number of enemies that can be knocked out with a single throw.

Constraints

  • 1N1051 \le N \le 10^5
  • 2L1052 \le L \le 10^5
  • 0<X<L0 < X < L
  • 0<xi<L0 < x_i < L
  • 0<yi1050 < y_i \le 10^5
  • All coordinates are integers.