#include <bits/stdc++.h>
using namespace std;
int n;
vector<pair<long long int, long long int> > v;
long long int lef[200002 * 2 + 6];
long long int rig[200002 * 2 + 6];
long long int tmp[200002 * 2 + 6];
long long int up[200002 * 2 + 6];
long long int dw[200002 * 2 + 6];
struct BIT {
  vector<long long int> bit;
  void add(int i, int x) {
    i++;
    while (i < bit.size()) {
      bit[i] += x;
      i += i & -i;
    }
  }
  int sum(int x) {
    x++;
    int r = 0;
    while (x) {
      r += bit[x];
      x -= x & -x;
    }
    return r;
  }
  BIT() { bit.resize(200002 * 2 + 8, 0); }
};
class sol {
 public:
  vector<int> star[200002 * 2 + 6];
  vector<int> en[200002 * 2 + 6];
  BIT B[2];
  long long int solve() {
    n = v.size();
    if (v.size() == 0) return 0;
    for (int i = 0; i < 200002 * 2 + 6; i++) {
      lef[i] = INT_MAX;
      up[i] = INT_MAX;
      rig[i] = INT_MIN;
      dw[i] = INT_MIN;
    }
    {
      long long int *p = lef;
      p += 200002 + 2;
      for (int i = 0; i < n; i++) {
        p[v[i].first] = min(p[v[i].first], v[i].second + 200002 + 2);
      }
      for (int i = 0; i < 200002 * 2 + 6; i++) {
        tmp[i] = lef[i];
      }
      long long int cur = tmp[0];
      for (int i = 1; i < 200002 * 2 + 6; i++) {
        cur++;
        cur = min(cur, tmp[i]);
        lef[i] = min(lef[i], cur);
      }
      cur = tmp[200002 * 2 - 1];
      for (int i = 200002 * 2 - 1; i >= 0; i--) {
        cur++;
        cur = min(cur, tmp[i]);
        lef[i] = min(lef[i], cur);
      }
    }
    {
      long long int *p = rig;
      p += 200002 + 2;
      for (int i = 0; i < n; i++) {
        p[v[i].first] = max(p[v[i].first], v[i].second + 200002 + 2);
      }
      for (int i = 0; i < 200002 * 2 + 6; i++) {
        tmp[i] = rig[i];
      }
      long long int cur = tmp[0];
      for (int i = 1; i < 200002 * 2 + 6; i++) {
        cur--;
        cur = max(cur, tmp[i]);
        rig[i] = max(rig[i], cur);
      }
      cur = tmp[200002 * 2 - 1];
      for (int i = 200002 * 2 - 1; i >= 0; i--) {
        cur--;
        cur = max(cur, tmp[i]);
        rig[i] = max(rig[i], cur);
      }
    }
    {
      long long int *p = up;
      p += 200002 + 2;
      for (int i = 0; i < n; i++) {
        p[v[i].second] = min(p[v[i].second], v[i].first + 200002 + 2);
      }
      for (int i = 0; i < 200002 * 2 + 6; i++) {
        tmp[i] = up[i];
      }
      long long int cur = tmp[0];
      for (int i = 1; i < 200002 * 2 + 6; i++) {
        cur++;
        cur = min(cur, tmp[i]);
        up[i] = min(up[i], cur);
      }
      cur = tmp[200002 * 2 - 1];
      for (int i = 200002 * 2 - 1; i >= 0; i--) {
        cur++;
        cur = min(cur, tmp[i]);
        up[i] = min(up[i], cur);
      }
    }
    {
      long long int *p = dw;
      p += 200002 + 2;
      for (int i = 0; i < n; i++) {
        p[v[i].second] = max(p[v[i].second], v[i].first + 200002 + 2);
      }
      for (int i = 0; i < 200002 * 2 + 6; i++) {
        tmp[i] = dw[i];
      }
      long long int cur = tmp[0];
      for (int i = 1; i < 200002 * 2 + 6; i++) {
        cur--;
        cur = max(cur, tmp[i]);
        dw[i] = max(dw[i], cur);
      }
      cur = tmp[200002 * 2 - 1];
      for (int i = 200002 * 2 - 1; i >= 0; i--) {
        cur--;
        cur = max(cur, tmp[i]);
        dw[i] = max(dw[i], cur);
      }
    }
    for (int i = 0; i < 200002 * 2 + 6; i++) {
      if (up[i] <= dw[i]) {
        up[i] = max(up[i], 0LL);
        dw[i] = min(dw[i], 200002 * 2LL + 5LL);
        star[up[i]].push_back(i);
        en[dw[i]].push_back(i);
      }
    }
    long long int r = 0;
    for (int i = 0; i < 200002 * 2 + 6; i++) {
      for (int el : star[i]) {
        B[(el + 300000) % 2].add(el, 1);
      }
      int x = lef[i];
      int y = rig[i];
      x = max(x, 0);
      y = min(y, 200002 * 2 + 4);
      if (x > y) continue;
      for (int j = 0; j < 2; j++) {
        int c = i + j;
        c += 2000000;
        c %= 2;
        if (c != (v[0].first + v[0].second + 1000000) % 2) {
          int inc = r;
          r += B[j].sum(y);
          if (x) r -= B[j].sum(x - 1);
          inc = r - inc;
        }
      }
      for (int el : en[i]) {
        B[(el + 300000) % 2].add(el, -1);
      }
    }
    return r;
  }
};
vector<pair<long long int, long long int> > vv[2];
sol s1;
sol s2;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    vv[(a + b + 300000) % 2].push_back(make_pair(a, b));
  }
  long long int ans = 0;
  v = vv[0];
  ans += s1.solve();
  v = vv[1];
  ans += s2.solve();
  printf("%lld\n", ans);
  return 0;
}
