Bajtazar owns a large collection of maps of Poland. Some are road maps, others are tourist maps, and so on. Every map has the shape of a rectangle, and a map may be rotated arbitrarily. Each map carries useful information about various places across the country.
Standing at a particular point, Bajtazar would like that point to appear on every one of his maps at once. He therefore wonders about the shape of the region that all the maps have in common. This common region is always a convex polygon, and your only task is to determine how many edges it has.
Task
The first line contains one integer n (1≤n≤106), the number of rectangles.
Each of the next n lines describes one rectangle with eight integers separated by single spaces: the coordinate pairs (x1,y1) (x2,y2) (x3,y3) (x4,y4) of its four vertices listed in counter-clockwise order. Every coordinate satisfies 1≤x,y≤104.
You may assume that the area of the common region of all the rectangles is strictly greater than 0.
Print a single integer: the number of edges of the polygon formed by the common region of the rectangles.
