5
-728000 477000
667000 186000
667000 151000
-595000 -679000
-298000 -132000
601001979001
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)