#include <bits/stdc++.h>
using namespace std;
int n;
int black[65536 * 8];
int id[65536 * 8];
vector<int> here[65536 * 8];
multiset<int> bef[2], nxt[2];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    id[i] = (abs(x + y)) % 2;
    black[i] = x - y;
    here[x + y + 200008].push_back(i);
    nxt[id[i]].insert(x - y);
  }
  long long ans = 0;
  for (int i = 0; i <= 400005; i++) {
    for (int j = 0; j < here[i].size(); j++)
      nxt[id[here[i][j]]].erase(nxt[id[here[i][j]]].find(black[here[i][j]]));
    for (int j = 0; j < 2; j++) {
      if (bef[j].size() != 0 and nxt[j].size() != 0) {
        int r1 = *bef[j].rbegin(), l1 = *bef[j].begin();
        int r2 = *nxt[j].rbegin(), l2 = *nxt[j].begin();
        if (l1 > r2 or l2 > r1) continue;
        if (l1 > l2) swap(l1, l2);
        long long res = min(r2 - l2, r1 - l2);
        if (j % 2 == i % 2) continue;
        ans += res / 2ll;
      }
    }
    for (int j = 0; j < here[i].size(); j++)
      bef[id[here[i][j]]].insert((black[here[i][j]]));
  }
  cout << ans;
  return 0;
}
