import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.Deque;
import java.util.Scanner;
import java.util.Stack;
import java.util.StringTokenizer;

public class convex_sm {

	final double EPS = 1e-6;

	class Point implements Comparable<Point> {
		long x, y;
		double ang;

		public Point(int x, int y) {
			this.x = x;
			this.y = y;
		}

		void calcAng(Point p) {
			ang = Math.atan2(y - p.y, x - p.x);
			while (ang < -EPS) {
				ang += 2 * Math.PI;
			}
		}

		@Override
		public int compareTo(Point o) {
			if (ang < o.ang)
				return -1;
			if (ang > o.ang)
				return 1;
			return 0;
		}

		@Override
		public String toString() {
			return x + " " + y;
		}
	}

	private void solve() throws IOException {
		int n = Integer.parseInt(in.readLine());
		assert 3 <= n && n <= 100000;
		Point[] p = new Point[n];
		for (int i = 0; i < p.length; i++) {
			StringTokenizer st = new StringTokenizer(in.readLine());
			p[i] = new Point(Integer.parseInt(st.nextToken()), Integer.parseInt(st.nextToken()));
			assert -1000000000 <= p[i].x && p[i].x <= 1000000000;
			assert -1000000000 <= p[i].y && p[i].y <= 1000000000;
		}
		int best = -1;
		for (int i = 0; i < p.length; i++) {
			if (best == -1 || p[i].y < p[best].y
					|| (p[i].y == p[best].y && p[i].x < p[best].x)) {
				best = i;
			}
		}

		{
			Point tmp = p[best];
			p[best] = p[0];
			p[0] = tmp;
		}

		for (int i = 1; i < p.length; i++) {
			p[i].calcAng(p[0]);
		}
		Arrays.sort(p, 1, p.length);
		Stack<Point> s = new Stack<Point>();
		s.add(p[0]);
		s.add(p[1]);
		for (int i = 2; i < p.length; i++) {
			while (s.size() > 2) {
				Point last = s.peek();
				Point prelast = s.get(s.size() - 2);
				long q = (last.x - prelast.x) * (p[i].y - last.y)
						- (last.y - prelast.y) * (p[i].x - last.x);
				if (q <= 0) {
					s.pop();
				} else {
					break;
				}
			}
			s.add(p[i]);
		}
		long S = 0;
		long P = 0;
		for (int i = 0; i < s.size(); i++) {
			S += s.get(i).x * s.get((i + 1) % s.size()).y - s.get(i).y
					* s.get((i + 1) % s.size()).x;
			P += gcd(s.get(i).x - s.get((i + 1) % s.size()).x, s.get(i).y
					- s.get((i + 1) % s.size()).y);
		}
		S = Math.abs(S);
		System.err.println(s);
		System.err.println(S + " " + P);
		out.println((S - P) / 2 + 1);

	}

	long gcd(long a, long b) {
		a = Math.abs(a);
		b = Math.abs(b);
		if (a == 0)
			return b;
		return gcd(b % a, a);
	}

	BufferedReader in;
	PrintWriter out;

	void run() {
		try {
			in = new BufferedReader(new FileReader("convex.in"));
			out = new PrintWriter("convex.out");
			solve();
			out.close();
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	}

	public static void main(String[] args) {
		new convex_sm().run();
	}

}
//