Paper Map

No attempts yetTime limit20sMemory limit128 MB

Problem

Making a map is not simple. Because the Earth is round, moving it onto a two dimensional plane introduces distortion, and a high resolution map is far too large to fit on a single sheet of paper. So the map is split into several pieces, printed on several sheets, and joined together.

We want to print a map using as few sheets as possible. Every sheet has the same size.

The same map can need a different number of sheets depending on how the sheets are placed. For example, one placement might print the map on 14 sheets, while a better placement needs only 10. Both placements use sheets of the same size and orientation.

Given the map, find the minimum number of sheets needed to print it. The map is a single closed polygon whose edges do not cross.

Every sheet is an axis aligned rectangle and cannot be rotated. Neighboring sheets meet corner to corner, forming one aligned grid, and you may translate the whole grid to any position you like. All input coordinates are integers, but the sheets may be placed at non integer positions.

If the map only touches the boundary line of a sheet, that sheet is not counted. In other words, a sheet is needed only when the area shared by its interior and the map interior is greater than 00. To absorb floating point error, the map poking outside a sheet by at most 10610^{-6} is ignored.

Input

The first line contains the number of map vertices nn (3n503 \le n \le 50) and the sheet size xsx_s, ysy_s (1xs,ys1001 \le x_s, y_s \le 100).

Each of the next nn lines contains the coordinates xx and yy of a map vertex (0x10xs0 \le x \le 10 x_s, 0y10ys0 \le y \le 10 y_s). The vertices are given in clockwise or counterclockwise order.

Output

Print, on a single line, the minimum number of sheets needed to print the map.