#include <bits/stdc++.h>
using namespace std;
long long n, sx, ssx, sy, ssy, x, y;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> x >> y;
    sx += x;
    sy += y;
    ssx = ssx + x * x;
    ssy = ssy + y * y;
  };
  long long tes = n * (ssx + ssy) - sx * sx - sy * sy;
  cout << tes;
};
