#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  long long s1, s2;
  long long sx, sy;
  long long x, y;
  s1 = 0;
  s2 = 0;
  sx = 0;
  sy = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    s1 += (n - 1) * x * x - 2 * sx * x;
    sx += x;
    s2 += (n - 1) * y * y - 2 * sy * y;
    sy += y;
  }
  cout << s1 + s2 << endl;
  return 0;
}
