#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int n;
int x[N], y[N];
long long get(int x[]) {
  long long s1 = 0, s2 = 0;
  for (int i = 0; i < n; i++) {
    s1 += x[i] * x[i];
    s2 += x[i];
  }
  return (n - 1) * s1 - (s2 * s2 - s1);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d%d", &x[i], &y[i]);
  cout << get(x) + get(y) << endl;
  return 0;
}
