#include <bits/stdc++.h>
using namespace std;
long long x[200000];
long long y[200000];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> x[i] >> y[i];
  long long xs = 0, x2s = 0, ys = 0, y2s = 0;
  for (int i = 0; i < n; i++) {
    xs += x[i];
    x2s += x[i] * x[i];
    ys += y[i];
    y2s += y[i] * y[i];
  }
  long long ans = n * x2s - xs * xs + n * y2s - ys * ys;
  cout << ans;
  return 0;
}
