#include <bits/stdc++.h>
using namespace std;
long long n, i, j, ans, sum1, sum2;
long long x[100000], y[100000];
int main() {
  scanf("%I64d", &n);
  sum1 = 0;
  sum2 = 0;
  ans = 0;
  for (i = 0; i < n; i++) {
    scanf("%I64d %I64d", &x[i], &y[i]);
    ans += (n * (x[i] * x[i] + y[i] * y[i]));
    sum1 += x[i];
    sum2 += y[i];
  }
  ans -= (sum1 * sum1);
  ans -= (sum2 * sum2);
  printf("%I64d\n", ans);
  return 0;
}
