#include <bits/stdc++.h>
using namespace std;
const int inf = 1000000007;
const int N = 201000;
int n;
long long ans = 0;
pair<int, int> pre[201000 << 2], suf[201000 << 2];
void upd(pair<int, int>& p, int z) {
  p.first = min(p.first, z), p.second = max(p.second, z);
}
void upd(pair<int, int>& p, pair<int, int> q) {
  p.first = min(p.first, q.first), p.second = max(p.second, q.second);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i <= N * 2; ++i) pre[i] = suf[i] = pair<int, int>(inf, -inf);
  for (int i = 1, x, y; i <= n; ++i) {
    scanf("%d%d", &x, &y);
    upd(pre[x + y + N], x - y);
    upd(suf[x + y + N], x - y);
  }
  for (int i = 2; i <= N * 2; ++i) upd(pre[i], pre[i - 2]);
  for (int i = N * 2 - 2; i >= 0; --i) upd(suf[i], suf[i + 2]);
  for (int i = 1; i <= N * 2; ++i)
    ans += max(0, min(pre[i - 1].second, suf[i + 1].second) -
                      max(pre[i - 1].first, suf[i + 1].first)) >>
           1;
  printf("%lld", ans);
}
