#include <bits/stdc++.h>
using namespace std;
const int max_n = 200111, inf = 1000111222;
bool comp(const pair<int, int>& p1, const pair<int, int>& p2) {
  return p1.second < p2.second;
}
struct segment_tree {
  int tree[max_n * 4] = {0};
  void set_v(int v, int l, int r, int pos, int val) {
    if (l == r) {
      tree[v] = val;
      return;
    }
    int mid = (l + r) / 2;
    if (pos <= mid) {
      set_v(v * 2, l, mid, pos, val);
    } else {
      set_v(v * 2 + 1, mid + 1, r, pos, val);
    }
    tree[v] = tree[v * 2] + tree[v * 2 + 1];
  }
  int sum(int v, int l, int r, int ql, int qr) {
    if (l == ql && r == qr) {
      return tree[v];
    }
    if (r < ql || l > qr) return 0;
    int mid = (l + r) / 2;
    return sum(v * 2, l, mid, ql, min(qr, mid)) +
           sum(v * 2 + 1, mid + 1, r, max(mid + 1, ql), qr);
  }
};
long long solve(vector<pair<int, int> > pts) {
  sort(pts.begin(), pts.end(), comp);
  vector<pair<int, int> > LR;
  vector<pair<int, int> > BT;
  int curp = 0;
  int L = inf, R = -inf;
  for (int row = 0; row < max_n; ++row) {
    ++L;
    --R;
    while (curp < pts.size() && pts[curp].second == row) {
      L = min(L, pts[curp].first + 1);
      R = max(R, pts[curp].first - 1);
      ++curp;
    }
    if (L > max_n) L = inf;
    if (R < 0) R = -inf;
    LR.push_back(make_pair(L, R));
  }
  curp = pts.size() - 1;
  L = inf, R = -inf;
  for (int row = max_n - 1; row >= 0; --row) {
    ++L;
    --R;
    while (curp >= 0 && pts[curp].second == row) {
      L = min(L, pts[curp].first + 1);
      R = max(R, pts[curp].first - 1);
      --curp;
    }
    if (L > max_n) L = inf;
    if (R < 0) R = -inf;
    LR[row].first = min(LR[row].first, L);
    LR[row].second = max(LR[row].second, R);
    if (LR[row].first > LR[row].second) {
      LR[row] = make_pair(inf, -inf);
    }
  }
  sort(pts.begin(), pts.end());
  curp = 0;
  int B = inf, T = -inf;
  for (int col = 0; col < max_n; ++col) {
    ++B;
    --T;
    while (curp < pts.size() && pts[curp].first == col) {
      B = min(B, pts[curp].second + 1);
      T = max(T, pts[curp].second - 1);
      ++curp;
    }
    if (B > max_n) B = inf;
    if (T < 0) T = -inf;
    BT.push_back(make_pair(B, T));
  }
  curp = pts.size() - 1;
  B = inf, T = -inf;
  for (int col = max_n - 1; col >= 0; --col) {
    ++B;
    --T;
    while (curp >= 0 && pts[curp].first == col) {
      B = min(B, pts[curp].second + 1);
      T = max(T, pts[curp].second - 1);
      --curp;
    }
    if (B > max_n) B = inf;
    if (T < 0) T = -inf;
    BT[col].first = min(BT[col].first, B);
    BT[col].second = max(BT[col].second, T);
    if (BT[col].first > BT[col].second) {
      BT[col] = make_pair(inf, -inf);
    }
  }
  vector<pair<int, int> > start;
  vector<pair<int, int> > finish;
  for (int i = 0; i < max_n; ++i) {
    if (BT[i].first == inf) continue;
    start.push_back(make_pair(i, BT[i].first));
    finish.push_back(make_pair(i, BT[i].second));
  }
  sort(start.begin(), start.end(), comp);
  sort(finish.begin(), finish.end(), comp);
  reverse(start.begin(), start.end());
  reverse(finish.begin(), finish.end());
  long long ans = 0;
  segment_tree st[2];
  for (int row = 0; row < max_n; ++row) {
    while (start.size() && start.back().second == row) {
      st[row % 2].set_v(1, 0, max_n - 1, start.back().first, 1);
      start.pop_back();
    }
    if (LR[row].first != inf) {
      ans += st[row % 2].sum(1, 0, max_n - 1, LR[row].first, LR[row].second);
    }
    while (finish.size() && finish.back().second == row) {
      st[row % 2].set_v(1, 0, max_n - 1, finish.back().first, 0);
      finish.pop_back();
    }
  }
  return ans;
}
int main() {
  vector<pair<int, int> > points1;
  vector<pair<int, int> > points2;
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int x, y;
    cin >> x >> y;
    x += 100000;
    y += 100000;
    if ((x + y) % 2 == 0) {
      points1.push_back(make_pair(x, y));
    } else {
      points2.push_back(make_pair(x, y));
    }
  }
  long long ans = solve(points1) + solve(points2);
  cout << ans;
  return 0;
}
