#include <bits/stdc++.h>
using namespace std;
int main() {
  long n;
  long long s = 0, sx = 0, sy = 0;
  int x, y;
  cin >> n;
  for (long i = 1; i <= n; ++i) {
    cin >> x >> y;
    s += (x * x + y * y);
    sx += x;
    sy += y;
  }
  cout << s * n - (sx * sx + sy * sy);
}
