#include <bits/stdc++.h>
using namespace std;
template <class t>
inline t read(t &x) {
  char c = getchar();
  bool f = 0;
  x = 0;
  while (!isdigit(c)) f |= c == '-', c = getchar();
  while (isdigit(c)) x = (x << 1) + (x << 3) + (c ^ 48), c = getchar();
  if (f) x = -x;
  return x;
}
template <class t>
inline void write(t x) {
  if (x < 0)
    putchar('-'), write(-x);
  else {
    if (x > 9) write(x / 10);
    putchar('0' + x % 10);
  }
}
const long long N = 1e5 + 5;
long long n;
vector<pair<long long, long long> > odd, even;
long long calc(vector<pair<long long, long long> > &a) {
  sort(a.begin(), a.end());
  multiset<long long> s1, s2;
  for (auto first : a) s2.insert(first.second);
  long long ans = 0;
  for (long long i = 0; i + 1 < a.size(); i++) {
    s2.erase(s2.find(a[i].second));
    s1.insert(a[i].second);
    if (a[i].first == a[i + 1].first) continue;
    long long l = max(*s1.begin(), *s2.begin()) + 1,
              r = min(*--s1.end(), *--s2.end()) - 1;
    if (l <= r) ans += (a[i + 1].first - a[i].first) / 2 * ((r - l) / 2 + 1);
  }
  return ans;
}
signed main() {
  read(n);
  for (long long i = 1, first, second; i <= n; i++) {
    read(first);
    read(second);
    if (first + second & 1)
      odd.emplace_back(first + second, first - second);
    else
      even.emplace_back(first + second, first - second);
  }
  write(calc(odd) + calc(even));
}
