#include <bits/stdc++.h>
using namespace std;
const int maxn = 200005;
int fwt[maxn];
int fwt2[maxn];
void add(int x) {
  while (x < maxn) {
    fwt[x]++;
    x += (-x) & x;
  }
}
void rem(int x) {
  while (x < maxn) {
    fwt[x]--;
    x += (-x) & x;
  }
}
int get(int x) {
  int s = 0;
  while (x) {
    s += fwt[x];
    x -= (-x) & x;
  }
  return s;
}
void add2(int x) {
  while (x < maxn) {
    fwt2[x]++;
    x += (-x) & x;
  }
}
void rem2(int x) {
  while (x < maxn) {
    fwt2[x]--;
    x += (-x) & x;
  }
}
int get2(int x) {
  int s = 0;
  while (x) {
    s += fwt2[x];
    x -= (-x) & x;
  }
  return s;
}
vector<pair<int, int>> p;
bool comp1(pair<int, int> p1, pair<int, int> p2) {
  return p1.second > p2.second;
}
int L[maxn], R[maxn];
int LL[maxn], RR[maxn];
vector<int> added[maxn];
int cover[maxn];
long long ans = 0;
int n;
void solve(int parity) {
  L[200002] = 200001;
  R[200002] = -1;
  for (int y = 200001, i = 0; y >= 1; y--) {
    L[y] = L[y + 1] + 1;
    R[y] = R[y + 1] - 1;
    while (i < n && p[i].second == y) {
      L[y] = min(L[y], p[i].first + 1);
      R[y] = max(R[y], p[i].first - 1);
      i++;
    }
  }
  LL[0] = 200001;
  RR[0] = -1;
  for (int y = 1, i = n - 1; y <= 200001; y++) {
    LL[y] = LL[y - 1] + 1;
    RR[y] = RR[y - 1] - 1;
    while (i >= 0 && p[i].second == y) {
      LL[y] = min(LL[y], p[i].first + 1);
      RR[y] = max(RR[y], p[i].first - 1);
      i--;
    }
    L[y] = min(L[y], LL[y]);
    R[y] = max(R[y], RR[y]);
  }
  vector<int> active;
  for (int y = 200001, i = 0; y >= 1; y--) {
    vector<int> new_active;
    for (int x : active) {
      for (int d = -1; d <= 1; d += 2) {
        if (x + d >= 1 && x + d <= 200001 && !cover[x + d]) {
          new_active.push_back(x + d);
          cover[x + d] = 1;
          added[y].push_back(x + d);
        }
      }
    }
    while (i < n && p[i].second == y + 1) {
      int x = p[i].first;
      if (!cover[x]) {
        new_active.push_back(x);
        cover[x] = 1;
        added[y].push_back(x);
      }
      i++;
    }
    active = new_active;
  }
  active.clear();
  for (int y = 1, i = n - 1; y <= 200001; y++) {
    vector<int> new_active;
    for (int x : active) {
      for (int d = -1; d <= 1; d += 2) {
        if (x + d >= 1 && x + d <= 200001 && cover[x + d] < 2) {
          new_active.push_back(x + d);
          cover[x + d] += 2;
          if (cover[x + d] == 3) {
            if ((x + d) % 2 == 0)
              add(x + d);
            else
              add2(x + d);
          }
        }
      }
    }
    while (i >= 0 && p[i].second == y - 1) {
      int x = p[i].first;
      if (cover[x] < 2) {
        new_active.push_back(x);
        cover[x] += 2;
        if (cover[x] == 3) {
          if (x % 2 == 0)
            add(x);
          else
            add2(x);
        }
      }
      i--;
    }
    if (L[y] <= R[y]) {
      if (y % 2 == parity)
        ans += get(R[y]) - get(L[y] - 1);
      else
        ans += get2(R[y]) - get2(L[y] - 1);
    }
    for (int x : added[y]) {
      if (cover[x] == 3) {
        if (x % 2 == 0)
          rem(x);
        else
          rem2(x);
      }
      cover[x]--;
    }
    active = new_active;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  vector<pair<int, int>> P(n);
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    x += 100001;
    y += 100001;
    P[i] = {x, y};
  }
  sort(P.begin(), P.end(), comp1);
  for (auto pp : P) {
    if ((pp.first + pp.second) % 2 == 1) {
      p.push_back(pp);
    }
  }
  n = p.size();
  solve(0);
  p.clear();
  memset(fwt, 0, sizeof fwt);
  memset(fwt2, 0, sizeof fwt2);
  for (int y = 0; y <= 200001; y++) added[y].clear();
  memset(cover, 0, sizeof cover);
  for (auto pp : P) {
    if ((pp.first + pp.second) % 2 == 0) {
      p.push_back(pp);
    }
  }
  n = p.size();
  solve(1);
  cout << ans << endl;
}
