#include <bits/stdc++.h>
using namespace std;
int n;
long long x[100005], y[100005], sumx, sumy, sumx2, sumy2;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    int tx, ty;
    scanf("%d%d", &tx, &ty);
    x[i] = tx;
    y[i] = ty;
    sumx += x[i];
    sumy += y[i];
    sumx2 += x[i] * x[i];
    sumy2 += y[i] * y[i];
  }
  long long ans = 0;
  ans += 2 * n * sumx2;
  ans -= 2 * sumx * sumx;
  ans += 2 * n * sumy2;
  ans -= 2 * sumy * sumy;
  cout << ans / 2 << endl;
}
