#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, X[100010], Y[100010], sumx1 = 0, sumy1 = 0, sumx = 0, sumy = 0,
                                     ans = 0;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> X[i] >> Y[i];
    sumx1 += (N - 1) * X[i] * X[i];
    sumy1 += (N - 1) * Y[i] * Y[i];
    sumx += X[i];
    sumy += Y[i];
  }
  ans = sumx1 + sumy1;
  for (int i = 0; i < N - 1; i++) {
    ans -= 2 * (sumx - X[i]) * X[i];
    sumx = sumx - X[i];
    ans -= 2 * (sumy - Y[i]) * Y[i];
    sumy = sumy - Y[i];
  }
  cout << ans << "\n";
}
