#include <bits/stdc++.h>
#pragma comment(linker, "/stack:16777216")
using namespace std;
const int INF = 1000000000;
const int MAX = 600000;
const int ADD = 200002;
const int BASE = 1000000000;
int n;
pair<int, int> P[MAX];
vector<int> D[MAX];
set<pair<int, int> > A[2];
set<pair<int, int> > B[2];
set<pair<int, int> > C[2];
void move(int d) {
  int p = d % 2;
  int pp = p ^ 1;
  for (set<pair<int, int> >::iterator it = B[p].begin(); it != B[p].end(); ++it)
    A[p].insert(*it);
  B[p].clear();
  for (int i = (0); i < ((int)D[d + 1].size()); ++i) {
    int id = D[d + 1][i];
    int x = P[id].first + P[id].second;
    C[pp].erase(C[pp].find(make_pair(x, id)));
    B[pp].insert(make_pair(x, id));
  }
}
int main() {
  cin >> n;
  for (int i = (0); i < (n); ++i) {
    int x, y;
    scanf("%d %d", &x, &y);
    --x;
    --y;
    P[i] = make_pair(x, y);
    D[x - y + ADD].push_back(i);
  }
  for (int i = (0); i < (n); ++i) {
    int d = P[i].first - P[i].second + ADD;
    C[d % 2].insert(make_pair(P[i].first + P[i].second, i));
  }
  long long res = 0;
  for (int i = (0); i < (MAX - 1); ++i) {
    int p = i % 2;
    int pp = p ^ 1;
    if ((int)A[pp].size() > 1 && (int)C[pp].size() > 1) {
      int la = A[pp].begin()->first;
      int ra = A[pp].rbegin()->first;
      int lc = C[pp].begin()->first;
      int rc = C[pp].rbegin()->first;
      int l = max(la, lc);
      int r = min(ra, rc);
      if (l < r) {
        res += (r - l) / 2;
      }
    }
    move(i);
  }
  cout << res << endl;
  return 0;
}
