#include<cstdio>
using namespace std;
long long n,neizheng;
double sum;
double x[1500],y[1500];
double fabs(double x)
{return x<0?-x:x;}
long long abs(long long a)
{return a<0?-a:a;}
long long gcd(long long a,long long b)
{return b==0?a:gcd(b,a%b);}
int main()
{
freopen("sistercookies.in","r",stdin);freopen("sistercookies.out","w",stdout);
scanf("%lld",&n);
for(int i=1;i<=n;i++)
{
scanf("%lf%lf",&x[i],&y[i]);
}
x[n+1]=x[1];y[n+1]=y[1];
for(int i=1;i<=n;i++)
{
sum+=(x[i+1]*y[i]-x[i]*y[i+1]);
}
double areas=fabs(sum)/2;
for(int i=1;i<=n;i++)
{
neizheng+=gcd(abs(x[i+1]-x[i]),abs(y[i+1]-y[i]))-1;
}
neizheng+=n;
printf("%lld\n",(long long)(areas+1.0-neizheng*0.5+0.5));
}