#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int n0 = 400001;
int n;
multiset<int> L[2], R[2];
vector<int> add[n0];
int even(int l, int r) { return max(0, r / 2 - (l - 1) / 2); }
int odd(int l, int r) { return max(0, (r - l + 1) - even(l, r)); }
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    int d = n0 / 2 + x - y, a = n0 / 2 + x + y;
    add[d].push_back(a);
    L[d & 1].insert(a);
  }
  long long ans = 0;
  for (int i = 0; i < n0; i++) {
    int I = i & 1;
    for (int j : add[i]) {
      L[I].erase(L[I].find(j));
      R[I].insert(j);
    }
    int mn1 = L[I].empty() ? n0 : *begin(L[I]);
    int mn2 = R[I].empty() ? n0 : *begin(R[I]);
    int l = max(mn1, mn2);
    int mx1 = L[I].empty() ? -1 : *(--end(L[I]));
    int mx2 = R[I].empty() ? -1 : *(--end(R[I]));
    int r = min(mx1, mx2);
    if (I)
      ans += even(l + 1, r - 1);
    else
      ans += odd(l + 1, r - 1);
  }
  cout << ans;
}
