#include <bits/stdc++.h>
using namespace std;
const int N = 1000000;
const int XXX = N / 2;
int n, xi[N], yi[N];
struct node {
  int x, y;
};
int comp(node a, node b) { return a.x < b.x; }
struct solver {
  node P[N];
  int tot;
  long long H[N], D[N];
  solver() { tot = 0; }
  void insert(int x, int y) { P[++tot] = (node){x, y}; }
  long long calc() {
    if (tot <= 1) return 0;
    long long res = 0;
    sort(P + 1, P + tot + 1, comp);
    {
      node L = P[1];
      for (int i = 2; i <= tot; ++i)
        if (P[i].y >= L.y) {
          for (int j = L.x; j < P[i].x; ++j) H[j + XXX] = L.y;
          L = P[i];
        }
      node R = P[tot];
      for (int i = tot - 1; i >= 1; --i)
        if (P[i].y >= R.y) {
          for (int j = P[i].x; j < R.x; ++j) H[j + XXX] = R.y;
          R = P[i];
        }
    }
    {
      node L = P[1];
      for (int i = 2; i <= tot; ++i)
        if (P[i].y <= L.y) {
          for (int j = L.x; j < P[i].x; ++j) D[j + XXX] = L.y;
          L = P[i];
        }
      node R = P[tot];
      for (int i = tot - 1; i >= 1; --i)
        if (P[i].y <= R.y) {
          for (int j = P[i].x; j < R.x; ++j) D[j + XXX] = R.y;
          R = P[i];
        }
    }
    for (int i = P[1].x; i < P[tot].x; ++i)
      res += max(0ll, H[i + XXX] - D[i + XXX]);
    return res;
  }
} F[2];
int main() {
  ios ::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> xi[i] >> yi[i];
    F[((xi[i] ^ yi[i]) & 1)].insert(
        (xi[i] + yi[i] - ((xi[i] ^ yi[i]) & 1)) / 2,
        (xi[i] - yi[i] - ((xi[i] ^ yi[i]) & 1)) / 2);
  }
  cout << F[0].calc() + F[1].calc() << endl;
}
