You have a polygon described by coordinates of its vertices. Can you find how many points with integer coordinates lay strictly inside it?

Input
The first line contains an integer N - number of vertices.
Next N lines contain 2 space-separated integers each and describe polygon vertices in clockwise order. Note that polygon can be convex and non-convex as well.

Output
Output one integer - answer for the problem

Constraints
3 ≤ N ≤ 1000 
|xi|, |yi| ≤ 10^6

SAMPLE INPUT
4
0 0
0 2
2 2
2 0

SAMPLE OUTPUT
1
def GCD(a , b) :
	if b == 0 :
		return a
	else:
	 return GCD(b,a%b)

n = input()
x = []
y = []

for i in range(0,n):
	x1,y1 = map(int, raw_input().split())
	x.append(x1)
	y.append(y1)

area = 0;
bound = 0;
x.append(x[0])
y.append(y[0])

for i in range(0,n):
	area += ((x[i+1]*y[i])-(y[i+1]*x[i]))

for i in range(0,n):
	tx = x[i+1]-x[i]
	ty = y[i+1]-y[i]
	if tx < 0 :
		tx *= -1
	if ty < 0 :
		ty *= -1
	bound += GCD(tx,ty)


ans = (area+2-bound)/2
print(ans)