#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
long long x[maxn], y[maxn];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n;
  cin >> n;
  long long s = 0, sx = 0, sy = 0;
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i];
    sx += x[i];
    sy += y[i];
    s += (n - 1) * (x[i] * x[i]) + (n - 1) * (y[i] * y[i]);
  }
  for (int i = 0; i < n; i++) {
    s -= ((x[i] * (sx - x[i])) + (y[i] * (sy - y[i])));
  }
  cout << s;
  return 0;
}
