A decorative railing follows the boundary of a simple polygon whose n vertices have integer coordinates, listed in order around the perimeter. Support posts must be placed at every integer grid point that lies on the railing (on an edge or at a vertex). Count how many such boundary grid points there are.
Input format
Line 1: an integer n, the number of vertices.
Next n lines: two integers x y, the vertices in boundary order.
Output format
A single integer: the number of integer grid points on the polygon boundary.
Constraints
- 3 <= n <= 100000
- -1000000 <= x, y <= 1000000
- The vertices describe a simple (non-self-intersecting) polygon.