#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int inf = 50000000;
const int maxn = 100010;
int x[maxn], y[maxn];
int main() {
  int n, i, j;
  long long ans = 0, xsum, ysum;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d%d", &x[i], &y[i]);
    ans = ans + (1ll * x[i] * x[i] + 1ll * y[i] * y[i]) * 1ll * (n - 1);
  }
  xsum = ysum = 0;
  for (i = 0; i < n; i++) {
    ans = ans - 2ll * xsum * x[i] - 2ll * ysum * y[i];
    xsum += x[i];
    ysum += y[i];
  }
  printf("%lld\n", ans);
  return 0;
}
