#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long long int sumx, sumy, sumx2, sumy2;
  sumx = sumy = sumx2 = sumy2 = 0;
  long long int x, y;
  cin >> n;
  int l = n;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    sumx += x;
    sumy += y;
    sumx2 += x * x;
    sumy2 += y * y;
  }
  long long int ans = l * (sumx2 + sumy2) - (sumx * sumx + sumy * sumy);
  cout << ans << endl;
  return 0;
}
