Point in polygon#878

Point in polygon

1 second
64 megabytes
Very easy

A polygon in the plane is given by the integer coordinates of its vertices in the Cartesian coordinate system. Find the number of points with integer coordinates lying strictly inside the polygon (not on the border). The sides of the polygon do not touch or intersect except at their common vertices.

Input

The first line contains the number (3 \leq n \leq 10000). Each of the following lines contains a pair of integers: the coordinates of a vertex. All coordinates are integers with absolute value not exceeding . If you connect the points in the given order, and also connect the first and the last point, you obtain the polygon.

Output

Output a single integer: the number of points with integer coordinates strictly inside the polygon.

Examples

Example 1

Loading
Loading