#include <bits/stdc++.h>
using namespace std;
int n, x, y;
int main() {
  cin >> n;
  long long ansy = 0, ansx = 0, sumx = 0, sumy = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &x, &y);
    ansx += x * x;
    ansy += y * y;
    sumx += x;
    sumy += y;
  }
  cout << (ansx * n + ansy * n - sumx * sumx - sumy * sumy) << endl;
  return 0;
}
