#include <bits/stdc++.h>
using namespace std;
int a[100002][2] = {};
int main() {
  long long a, b, x, y, n, s1, s2, s3, s4;
  s1 = s2 = s3 = s4 = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a >> b;
    s1 += a * a;
    s2 += b * b;
    s3 += a;
    s4 += b;
  }
  cout << (n * (s1 + s2) - s3 * s3 - s4 * s4);
  return 0;
}
