#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x, y;
  cin >> n;
  long long sumX = 0;
  long long sumY = 0;
  long long sum = 0;
  for (int i = n; i > 0; i--) {
    cin >> x;
    cin >> y;
    sumX += x;
    sum += x * x;
    sumY += y;
    sum += y * y;
  }
  printf("%I64d", (n * sum) - (sumX * sumX) - (sumY * sumY));
  printf("\n");
  return 0;
}
