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