#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int x, y;
  long long res = 0;
  long long x2 = 0;
  long long y2 = 0;
  long long sumX = 0;
  long long sumY = 0;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    res += x2;
    res -= 2 * sumX * x;
    res += i * (long long)x * x;
    x2 += x * x;
    sumX += x;
    res += y2;
    res -= 2 * sumY * y;
    res += i * (long long)y * y;
    y2 += y * y;
    sumY += y;
  }
  cout << res << endl;
  return 0;
}
