#include <bits/stdc++.h>
using namespace std;
long long x[120000], y[120000];
long long sx, sy;
int main() {
  int i, j, k, n;
  scanf("%d", &n);
  long long ans = 0;
  sx = 0;
  sy = 0;
  for (i = 1; i <= n; i++) {
    int q, w;
    scanf("%d%d", &q, &w);
    x[i] = q;
    y[i] = w;
    sx += x[i];
    sy += y[i];
    ans += x[i] * x[i];
    ans += y[i] * y[i];
  }
  ans *= (long long)(n - 1);
  long long tt = 0;
  for (i = 1; i <= n; i++) {
    tt += x[i] * (sx - x[i]);
    tt += y[i] * (sy - y[i]);
  }
  ans -= tt;
  cout << ans << endl;
  return 0;
}
