#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int n;
long long x[N], y[N];
long long cal(long long *x) {
  long long sum = 0, ans = 0;
  for (int i = 1; i <= n; i++) sum += x[i];
  for (int i = 1; i <= n; i++)
    ans += 2 * x[i] * x[i] * (n - 1) - 2 * x[i] * (sum - x[i]);
  return ans / 2;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lld%lld", &x[i], &y[i]);
  printf("%lld\n", cal(x) + cal(y));
  return 0;
}
