#include <bits/stdc++.h>
using namespace std;
const int maxn = 1 << 21;
const int pom = 100000;
set<int> x, y;
int main() {
  int n, a, b, l, r, minx = pom, miny = pom, maxx = -pom, maxy = -pom;
  cin >> n;
  while (n--) {
    cin >> a >> b;
    x.insert(a);
    y.insert(b);
    minx = min(minx, a);
    miny = min(miny, b);
    maxx = max(maxx, a);
    maxy = max(maxy, b);
  }
  if ((x.size() == 2) && (y.size() == 2)) {
    l = maxx - minx;
    r = maxy - miny;
    cout << l * r << endl;
  } else
    cout << "-1" << endl;
  return 0;
}
