#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
long long x[N], y[N];
long long sx[N], sy[N];
long long ssx[N], ssy[N];
int main() {
  int n;
  cin >> n;
  x[0] = y[0] = 0;
  sx[0] = sy[0] = 0;
  for (int i = 1; i <= n; i++) {
    cin >> x[i] >> y[i];
  }
  for (int i = 1; i <= n; i++) {
    sx[i] = sx[i - 1] + x[i] * x[i];
    sy[i] = sy[i - 1] + y[i] * y[i];
    ssx[i] = ssx[i - 1] + x[i];
    ssy[i] = ssy[i - 1] + y[i];
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    ans += x[i] * x[i] * (i - 1) - 2 * x[i] * ssx[i - 1] + sx[i - 1];
    ans += y[i] * y[i] * (i - 1) - 2 * y[i] * ssy[i - 1] + sy[i - 1];
  }
  cout << ans << endl;
  return 0;
}
