Count the convex polygons that are completely hidden from the origin by other polygons, since every ray stops at the first one it hits.
Hard8GeometrySortingIntervalsNo attempts yetTime limit1sMemory limit512 MBThe Naro Space Center (NSC) has found that n large meteorites are falling toward Korea. NSC plans to destroy all of them with a laser guided missile system. To miss none of them, NSC has to know which meteorites are completely blocked by other meteorites at a given moment. Such a meteorite is called an invisible meteorite.
Each meteorite is given as a convex polygon. The meteorites are separated from one another, so no two convex polygons meet. The laser guided missile launcher is at the origin (0,0) of the coordinate plane. A laser beam travels along a ray that starts at the launcher and stops at the first meteorite it meets. When no laser beam can touch any point of a meteorite, that meteorite is invisible.
The figure below shows a situation with five meteorites and the launcher. No laser beam from the launcher reaches any point of the meteorite labeled A, so it is an invisible meteorite.

Given the convex polygons that describe the meteorites at one moment, write a program that counts the meteorites that are invisible from the launcher.
The first line contains the number of convex polygons n (1≤n≤100000). Each of the next n lines contains 2m+1 integers m, x1, y1, x2, y2, ..., xm, ym. Here m is the number of vertices of a convex polygon Q, and (xi,yi) are the coordinates of the m vertices of Q listed in counter-clockwise order (3≤m≤105, −108≤xi≤108, 1≤yi≤108).
The sum of the numbers of vertices over all convex polygons is at most 106. No two convex polygons meet. Also, the line through any two vertices of all the convex polygons does not pass through the origin.
Print the number of meteorites that are invisible from the launcher on one line.