#include <bits/stdc++.h>
using namespace std;
int n, m, k;
bool debug = false;
int main() {
  scanf("%d", &n);
  int x, y;
  long long sum = 0, ss = 0, px = 0, py = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &x, &y);
    sum += (long long)x * x + (long long)y * y;
    ss += px * x + py * y;
    px += (long long)x;
    py += (long long)y;
  }
  sum = sum * (n - 1);
  sum -= 2 * ss;
  cout << sum << endl;
  return 0;
}
