#include <bits/stdc++.h>
using namespace std;
int main() {
  string s = "abcd";
  int n;
  while (scanf("%d", &n) == 1) {
    long long x = 0, y = 0, sumX = 0, sumY = 0, sumsqX = 0, sumsqY = 0;
    long long res = 0;
    for (int i = (0); i < (n); i++) {
      scanf("%I64d %I64d", &x, &y);
      res += i * (x * x) - 2 * x * sumX + sumsqX;
      res += i * (y * y) - 2 * y * sumY + sumsqY;
      sumX += x;
      sumY += y;
      sumsqX += x * x;
      sumsqY += y * y;
    }
    cout << res << endl;
  }
  return 0;
}
