#include <bits/stdc++.h>
using namespace std;
int main() {
  long long X = 0, Y = 0, t = 0;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    t += x * x + y * y;
    X += x;
    Y += y;
  }
  cout << n * t - X * X - Y * Y << endl;
  return 0;
}
