#include <bits/stdc++.h>
using namespace std;
int n;
long long sx = 0, sqx = 0, sy = 0, sqy = 0, ans = 0;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    int x, y;
    scanf("%d%d", &x, &y);
    sqx += x * x;
    sx += x;
    sqy += y * y;
    sy += y;
  }
  ans = n * (sqx + sqy) - (sy) * (sy) - (sx) * (sx);
  cout << ans << endl;
  return 0;
}
