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