#include <bits/stdc++.h>
using namespace std;
static const double EPS = 1e-10;
int dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};
int x[100000], y[100000];
int main() {
  int n;
  long long ans = 0;
  long long sxx = 0, syy = 0, sx = 0, sy = 0;
  cin >> n;
  for (int i = 0; i < (int)n; ++i) {
    cin >> x[i] >> y[i];
    sxx += x[i] * x[i];
    syy += y[i] * y[i];
    sx += x[i];
    sy += y[i];
  }
  ans += n * (sxx + syy);
  for (int i = 0; i < (int)n; ++i) {
    ans -= x[i] * sx + y[i] * sy;
  }
  cout << ans << endl;
}
