#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  vector<long long int> vx;
  vector<long long int> vy;
  long long int sumx = 0;
  long long int sumy = 0;
  long long int sqx = 0;
  long long int sqy = 0;
  for (int i = 0; i < n; i++) {
    long long int x, y;
    cin >> x >> y;
    sqx += x * x;
    sumx += x;
    vx.push_back(x);
    sqy += y * y;
    sumy += y;
    vy.push_back(y);
  }
  long long int answer = 0;
  for (int i = 0; i < n; i++) {
    answer += sqx + n * vx[i] * vx[i] - 2 * vx[i] * sumx;
    answer += sqy + n * vy[i] * vy[i] - 2 * vy[i] * sumy;
  }
  answer /= 2;
  cout << answer;
}
