#include <bits/stdc++.h>
using namespace std;
long long n, sx, sy, sumx, sumy;
long long x[100005], y[100005];
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> x[i] >> y[i];
    sx += x[i];
    sy += y[i];
    sumx += x[i] * x[i];
    sumy += y[i] * y[i];
  }
  long long solx = (n - 1) * sumx;
  long long soly = (n - 1) * sumy;
  for (int i = 1; i <= n; ++i) {
    sx -= x[i];
    sy -= y[i];
    solx -= 2 * sx * x[i];
    soly -= 2 * sy * y[i];
  }
  cout << solx + soly;
  return 0;
}
