#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int M = 1e9 + 7;
const int INF = 2e9 + 5;
const int rx[8] = {-1, 0, 1, 0, 1, 1, -1, -1};
const int ry[8] = {0, -1, 0, 1, 1, -1, 1, -1};
mt19937 gen(chrono::high_resolution_clock::now().time_since_epoch().count());
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<pair<long long, long long> > a(n);
  long long sumx = 0;
  long long sumy = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i].first >> a[i].second;
    sumx += a[i].first;
    sumy += a[i].second;
  }
  long long res = 0;
  for (int i = 0; i < n; i++) {
    res += (n - 1) * a[i].first * a[i].first - a[i].first * (sumx - a[i].first);
    res += (n - 1) * a[i].second * a[i].second -
           a[i].second * (sumy - a[i].second);
  }
  cout << res;
  return 0;
}
