#include <bits/stdc++.h>
using namespace std;
int n;
long long xx[100009], yy[100009];
long long sx, sy, ssx, ssy;
int main() {
  scanf("%d", &n);
  sx = ssx = sy = ssy = 0;
  for (int i = 0; i < (int)n; i++) {
    cin >> xx[i];
    sx += xx[i];
    ssx += xx[i] * xx[i];
    cin >> yy[i];
    sy += yy[i];
    ssy += yy[i] * yy[i];
  }
  long long ret = 0;
  for (int i = 0; i < (int)n; i++) {
    long long temp = sx - xx[i];
    temp = 2 * temp * (xx[i]);
    temp = -1 * temp;
    temp += ssx - xx[i] * xx[i];
    temp += (n - 1) * (xx[i] * xx[i]);
    ret += temp;
    temp = 0;
    temp = sy - yy[i];
    temp = 2 * temp * (yy[i]);
    temp = -1 * temp;
    temp += ssy - yy[i] * yy[i];
    temp += (n - 1) * (yy[i] * yy[i]);
    ret += temp;
  }
  ret = ret >> 1;
  cout << ret << endl;
}
