#include <bits/stdc++.h>
using namespace std;
const int oo = 1E9;
const int LEFT = 0;
const int RIGHT = 1;
const int UP = 2;
const int DOWN = 3;
const int MAX = 262144;
int msk[2 * MAX][4];
int full[2 * MAX][1 << 4];
void Reset() {
  memset(msk, 0, sizeof msk);
  memset(full, 0, sizeof full);
  for (int i = MAX; i < 2 * MAX; ++i) full[i][0] = 1;
  for (int i = MAX - 1; i > 0; --i)
    full[i][0] = full[2 * i][0] + full[2 * i + 1][0];
}
int buf[1 << 4];
void Update(int vr) {
  if (vr >= MAX) {
    memset(buf, 0, sizeof(buf));
    buf[0] = 1;
  } else {
    for (int i = 0; i < (1 << 4); ++i)
      buf[i] = full[2 * vr][i] + full[2 * vr + 1][i];
  }
  int* val = msk[vr];
  int upd = ((val[0] > 0) << 0) | ((val[1] > 0) << 1) | ((val[2] > 0) << 2) |
            ((val[3] > 0) << 3);
  fill(full[vr], full[vr] + (1 << 4), 0);
  for (int i = 0; i < (1 << 4); ++i) full[vr][i | upd] += buf[i];
}
void Add(int vr, int l, int r, int ql, int qr, int dir, int how) {
  if (r < ql || qr < l) return;
  if (ql <= l && r <= qr) {
    msk[vr][dir] += how;
    Update(vr);
    return;
  }
  int mid = (l + r) >> 1;
  Add(2 * vr, l, mid, ql, qr, dir, how);
  Add(2 * vr + 1, mid + 1, r, ql, qr, dir, how);
  Update(vr);
}
const int SPAN = 200010;
const int LIM = 100510;
struct Rect {
  int x1, x2;
  int y1, y2;
  int dir;
  Rect(int _x1, int _x2, int _y1, int _y2, int _dir) {
    x1 = _x1, x2 = _x2;
    y1 = _y1, y2 = _y2;
    dir = _dir;
    if (x1 == oo) x1 = x2 - SPAN;
    if (x2 == oo) x2 = x1 + SPAN;
    if (y1 == oo) y1 = y2 - SPAN;
    if (y2 == oo) y2 = y1 + SPAN;
    (x1) = max((x1), (-LIM));
    (x2) = min((x2), (LIM));
    (y1) = max((y1), (-LIM));
    (y2) = min((y2), (LIM));
  }
};
vector<pair<pair<int, int>, int>> add[MAX], rem[MAX];
long long MergeRects(vector<Rect>& r) {
  if (r.empty()) return 0;
  Reset();
  for (int i = 0; i < MAX; ++i) add[i].clear(), rem[i].clear();
  int minx = r[0].x1, miny = r[0].y1;
  for (int i = 0; i < ((int)(r).size()); ++i)
    (minx) = min((minx), (r[i].x1)), (miny) = min((miny), (r[i].y1));
  for (int i = 0; i < ((int)(r).size()); ++i)
    r[i].x1 -= minx, r[i].x2 -= minx, r[i].y1 -= miny, r[i].y2 -= miny;
  for (int i = 0; i < ((int)(r).size()); ++i) {
    add[r[i].x1].push_back(make_pair(make_pair(r[i].y1, r[i].y2), r[i].dir));
    rem[r[i].x2 + 1].push_back(
        make_pair(make_pair(r[i].y1, r[i].y2), r[i].dir));
  }
  long long ans = 0;
  int start = 1E9;
  for (int i = 0; i < MAX; ++i) {
    int x = i;
    auto& _add = add[x];
    auto& _rem = rem[x];
    if (_add.empty() && _rem.empty()) continue;
    if (start < x) {
      long long cnt = x - start;
      ans += cnt * full[1][(1 << 4) - 1];
    }
    for (const auto& p : _add)
      Add(1, 0, MAX - 1, p.first.first, p.first.second, p.second, +1);
    for (const auto& p : _rem)
      Add(1, 0, MAX - 1, p.first.first, p.first.second, p.second, -1);
    start = x;
  }
  return ans;
}
vector<Rect> nal[2];
void RectsForPoint(int x, int y) {
  int r = ((x + y) & 1) ^ 1;
  nal[r ^ 1].push_back(
      Rect((r + x + 1 - y) / 2, oo, (r + x + 1 + y) / 2, oo, DOWN));
  nal[r ^ 1].push_back(
      Rect(oo, (r + x - 1 - y) / 2, oo, (r + x - 1 + y) / 2, UP));
  nal[r ^ 1].push_back(
      Rect((r + x - (y - 1)) / 2, oo, oo, (r + x + (y - 1)) / 2, LEFT));
  nal[r ^ 1].push_back(
      Rect(oo, (r + x - (y + 1)) / 2, (r + x + (y + 1)) / 2, oo, RIGHT));
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    int x, y;
    scanf("%d%d", &x, &y);
    RectsForPoint(x, y);
  }
  cout << MergeRects(nal[0]) + MergeRects(nal[1]) << '\n';
  return 0;
}
