#include <bits/stdc++.h>
int x[100010], y[100010];
int main() {
  int n;
  scanf("%d ", &n);
  for (int i = 1; i <= n; i++) scanf("%d %d ", &x[i], &y[i]);
  long long xsum = 0, x2sum = 0, ysum = 0, y2sum = 0;
  for (int i = 1; i <= n; i++) {
    xsum += x[i];
    x2sum += (long long)x[i] * x[i];
    ysum += y[i];
    y2sum += (long long)y[i] * y[i];
  }
  long long ans = n * x2sum - xsum * xsum + n * y2sum - ysum * ysum;
  printf("%I64d", ans);
  return 0;
}
