#include <bits/stdc++.h>
using namespace std;
struct point {
  long long x;
  long long y;
};
int main() {
  long long count, sum = 0, sumy = 0, sumx = 0, sumhy = 0, sumhx = 0, sumh = 0;
  long long my = 0;
  long long mx = 0;
  point* points;
  cin >> count;
  points = new point[count];
  for (long long i = 0; i < count; i++) {
    cin >> points[i].x >> points[i].y;
    sumy += points[i].y;
    sumx += points[i].x;
    mx += points[i].x * points[i].x * (count - 1);
    my += points[i].y * points[i].y * (count - 1);
  }
  for (int i = 0; i < count - 1; i++) {
    sumy -= points[i].y;
    sumhy += points[i].y * (sumy);
    sumx -= points[i].x;
    sumhx += points[i].x * (sumx);
  }
  sumh = (sumhx + sumhy) * (-2);
  cout << mx + sumh + my << endl;
  return 0;
}
