#include <bits/stdc++.h>
using namespace std;
long long x[100005], y[100005];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> x[i] >> y[i];
  long long ret = 0;
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    ret += pow(x[i], 2) * (long long)(n - 1);
    ret -= 2LL * x[i] * sum;
    sum += x[i];
  }
  sum = 0;
  for (int i = 0; i < n; i++) {
    ret += pow(y[i], 2) * (long long)(n - 1);
    ret -= 2LL * y[i] * sum;
    sum += y[i];
  }
  cout << ret << endl;
}
