Farmer John's cows are standing at distinct locations (x_1, y_1), \ldots, (x_n, y_n) on his two-dimensional farm. FJ wants to partition his field by building a long (effectively infinite) north-south fence along the line x = a, where is an even integer, ensuring that the fence does not pass through the location of any cow. He also wants to build a long (effectively infinite) east-west fence along the line y = b, where is an even integer. These two fences intersect at the point and together divide the field into four regions.
FJ wants to choose and so that the cows in the four resulting regions are as evenly distributed as possible, with no region containing too many cows. Let be the maximum number of cows in any one of the four regions. FJ wants to make as small as possible. Please help him determine the minimum possible value of .
The first line contains one integer n~(1 \le n \le 1000). The next lines each contain the coordinates and of one cow. The coordinates are positive odd integers, each at most 10^6.
Print the minimum possible value of that FJ can achieve by positioning his fences optimally.
Example 1