#include <bits/stdc++.h>
using namespace std;
const int INF = (int)1e9;
int n;
long long x, y, sumx = 0, sumy = 0, qx = 0, qy = 0;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%I64d %I64d", &x, &y);
    sumx += x;
    sumy += y;
    qx += x * x;
    qy += y * y;
  }
  printf("%I64d\n", n * (qx + qy) - (sumx * sumx + sumy * sumy));
  return 0;
}
