Seeing the Boundary Farmer Bob watches the fence that surrounds his N meter by N meter square, flat field (2 <= N <= 500,000). One fence corner is at the origin (0, 0) and the opposite corner is at (N, N); the sides of Farmer Bob's fence are parallel to the X and Y axes. Fence posts appear at all four corners and also at every meter along each side of the fence, for a total of 4N fence posts. The fence posts are vertical and are considered to have no radius. Farmer Bob wants to determine how many of his fence posts he can watch when he stands at a given location within his fence. Farmer Bob's field contains R (1 <= R <= 30,000) huge rocks that obscure his view of some fence posts, as he is not tall enough to look over any of these rocks. The base of each rock is a convex polygon with nonzero area whose vertices are at integer coordinates. The rocks stand completely vertical. Rocks do not overlap, do not touch other rocks, and do not touch Farmer Bob or the fence. Farmer Bob does not touch the fence, does not stand within a rock, and does not stand on a rock. Given the size of Farmer Bob's fence, the locations and shapes of the rocks within it, and the location where Farmer Bob stands, compute the number of fence posts that Farmer Bob can see. If a vertex of a rock lines up perfectly with a fence post from Farmer Bob's location, he is not able to see that fence post. PROBLEM NAME: boundary INPUT FORMAT: * Line 1: Two space-separated integers: N and R. * Line 2: Two space-separated integers that specify the X and Y coordinates of Farmer Bob's location inside the fence. * Lines 3..End of input: The rest of the input file describes the R rocks: * Rock i's description starts with a line containing a single integer p_i (3 <= p_i <= 20), the number of vertices in the rock's base. * Each of the next p_i lines contains a space-separated pair of integers that are the X and Y coordinates of a vertex. The vertices of a rock's base are distinct and given in counterclockwise order. SAMPLE INPUT: 100 1 60 50 5 70 40 75 40 80 40 80 50 70 60 OUTPUT FORMAT: * Line 1: A single integer, the number of fence posts visible to Farmer Bob. SAMPLE OUTPUT: 319