#include <bits/stdc++.h>
const int MAXN = 2e5 + 233;
const int MAXM = 1e5 + 5;
int n;
std::vector<std::pair<int, int> > v[2];
std::vector<int> G[MAXN];
std::pair<int, int> pre[MAXN];
inline long long work(std::vector<std::pair<int, int> > &v) {
  if (v.empty()) return 0;
  for (int i = 1; i <= MAXN - 1; ++i) G[i].clear();
  for (auto x : v) G[x.second].push_back(x.first);
  int l = 1e9, r = 0;
  pre[0] = std::make_pair(l, r);
  for (int i = 1; i <= MAXN - 1; ++i) {
    for (auto x : G[i]) l = std::min(l, x), r = std::max(r, x);
    pre[i] = std::make_pair(l, r);
  }
  l = 1e9, r = 0;
  long long ans = 0;
  for (int i = MAXN - 1; i >= 1; --i) {
    for (auto x : G[i]) l = std::min(l, x), r = std::max(r, x);
    if (l >= r || pre[i - 1].first >= pre[i - 1].second) continue;
    int ll = std::max(l, pre[i - 1].first), rr = std::min(r, pre[i - 1].second);
    ans += std::max(0, rr - ll);
  }
  return ans;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    int x, y;
    scanf("%d%d", &x, &y);
    if ((x + y) & 1) {
      v[1].push_back(
          std::make_pair(MAXM + (x + y + 1) / 2, MAXM + (x - y - 1) / 2));
    } else {
      v[0].push_back(std::make_pair(MAXM + (x + y) / 2, MAXM + (x - y) / 2));
    }
  }
  printf("%lld\n", work(v[0]) + work(v[1]));
  return 0;
}
