#include <bits/stdc++.h>
using namespace std;
int main(int argc, char **argv) {
  int N;
  cin >> N;
  long long X[N], Y[N], X2 = 0, Y2 = 0, SX[N], SY[N];
  for (int i = (0); i < (N); ++i) cin >> X[i] >> Y[i];
  for (int i = (0); i < (N); ++i)
    X2 += X[i] * X[i], Y2 += Y[i] * Y[i], SX[i] = (i ? SX[i - 1] : 0) + X[i],
                                          SY[i] = (i ? SY[i - 1] : 0) + Y[i];
  long long res = 0;
  res = (N - 1) * (X2 + Y2);
  for (int i = (0); i < (N - 1); ++i)
    res -= 2 * (X[i] * (SX[N - 1] - SX[i]) + Y[i] * (SY[N - 1] - SY[i]));
  cout << res << endl;
  return 0;
}
