#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
int x[maxn], y[maxn];
int sumx[maxn], sumy[maxn];
int main() {
  int n;
  scanf("%d", &n);
  long long ans = 0;
  for (int i = 0; i < n; ++i) {
    scanf("%d%d", x + i, y + i);
    ans += 1LL * x[i] * x[i] * (n - 1);
    ans += 1LL * y[i] * y[i] * (n - 1);
  }
  for (int i = n - 1; i >= 0; --i) {
    sumx[i] = sumx[i + 1] + x[i];
    sumy[i] = sumy[i + 1] + y[i];
  }
  for (int i = 0; i < n; ++i) {
    ans -= 2LL * x[i] * sumx[i + 1];
    ans -= 2LL * y[i] * sumy[i + 1];
  }
  cout << ans;
  return 0;
}
