// Задача "Выпуклая оболочка"
// 4-я Интернет-олимпиада сезона 2009-2010, усложненный уровень.
// Автор задачи: Федор Царев, tsarev@rain.ifmo.ru
// Автор решения: Максим Буздалов, buzdalov@rain.ifmo.ru

import java.io.*;
import java.util.*;

public class convex_mb {
    static class Point {
        public final int x, y;
        public Point(int x, int y) {
            this.x = x;
            this.y = y;
        }
        public Point sub(Point a) {
            return new Point(x - a.x, y - a.y);
        }
        public long vmul(Point b) {
            return (long)x * b.y - (long)y * b.x;
        }
        public long smul(Point b) {
            return (long)x * b.x + (long)y * b.y;
        }
        public boolean leftTurn(Point from, Point to) {
            from = from.sub(this);
            to = to.sub(this);
            return from.vmul(to) > 0;
        }
        public int hashCode() {
            return x * 31 + y * 366239;
        }
        public boolean equals(Object o) {
            Point p = (Point) o;
            return x == p.x && y == p.y;
        }
    }

    static Point[] chull(Point[] pts) {
        for (int i = 1; i < pts.length; ++i) {
            Point curr = pts[i], zero = pts[0];
            if (zero.x > curr.x || zero.x == curr.x && zero.y > curr.y) {
                pts[0] = curr;
                pts[i] = zero;
            }
        }
        for (int i = pts.length - 1; i >= 0; --i) {
            pts[i] = pts[i].sub(pts[0]);
        }
        Arrays.sort(pts, 1, pts.length, new Comparator<Point>() {
            public int compare(Point a, Point b) {
                long vm = a.vmul(b);
                if (vm == 0) {
                    long sma = a.smul(a);
                    long smb = b.smul(b);
                    return sma == smb ? 0 : sma < smb ? -1 : 1;
                } else {
                    return vm > 0 ? -1 : 1;
                }
            }
        });
        List<Point> stack = new ArrayList<Point>();
        stack.add(pts[0]);
        stack.add(pts[1]);
        for (int i = 2; i < pts.length; ++i) {
            Point curr = pts[i];
            while (stack.size() >= 2 && !stack.get(stack.size() - 2).leftTurn(stack.get(stack.size() - 1), curr)) {
                stack.remove(stack.size() - 1);
            }
            stack.add(curr);
        }
        return stack.toArray(new Point[stack.size()]);
    }

    static void myAssert(String msg, boolean exp) {
        if (!exp) {
            throw new AssertionError(msg);
        }
    }

    static int gcd(int a, int b) {
        a = Math.abs(a);
        b = Math.abs(b);
        while (a != 0) {
            int t = b % a;
            b = a;
            a = t;
        }
        return b;
    }

    static int integerPointsOnSegment(Point start, Point end) {
        int gcd = gcd(start.x - end.x, start.y - end.y);
        return gcd - 1;
    }

    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new FileReader("convex.in"));
        int n = Integer.parseInt(in.readLine());
        myAssert("n is out of bounds", 3 <= n && n <= 100000);
        Point[] pts = new Point[n];
        Set<Point> ptsSet = new HashSet<Point>();
        for (int i = 0; i < n; ++i) {
            String ln = in.readLine();
            int space = ln.indexOf(' ');
            myAssert("wrong format of the point description", space != -1 && space == ln.lastIndexOf(' '));
            int x = Integer.parseInt(ln.substring(0, space));
            int y = Integer.parseInt(ln.substring(space + 1));
            myAssert("x is out of bounds", -1000000000 <= x && x <= 1000000000);
            myAssert("y is out of bounds", -1000000000 <= y && y <= 1000000000);
            pts[i] = new Point(x, y);
            myAssert("equal points found", !ptsSet.contains(pts[i]));
            ptsSet.add(pts[i]);
        }
        Point[] hull = chull(pts);
        myAssert("Poins are collinear", hull.length >= 3);

        long doubledSquare = hull[hull.length - 1].vmul(hull[0]);
        for (int i = 1; i < hull.length; ++i) {
            doubledSquare += hull[i - 1].vmul(hull[i]);
        }

        long integerPoints = hull.length + integerPointsOnSegment(hull[hull.length - 1], hull[0]);
        for (int i = 1; i < hull.length; ++i) {
            integerPoints += integerPointsOnSegment(hull[i - 1], hull[i]);
        }

        long doubledInside = doubledSquare + 2 - integerPoints;
        myAssert("Algorithm failed", doubledInside % 2 == 0);

        PrintWriter out = new PrintWriter("convex.out");
        out.println(doubledInside / 2);
        out.close();
    }
}
