#include <bits/stdc++.h>
using namespace std;
const long long int INF = 1e18;
const long long int MAX = 1e6 + 1;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  long long int x, y;
  long long int sqa = 0, sqb = 0, suma = 0, sumb = 0;
  for (long long int i = 0; i < n; i++) {
    cin >> x >> y;
    sqa += x * x;
    sqb += y * y;
    suma += x;
    sumb += y;
  }
  suma *= suma;
  sumb *= sumb;
  long long int temp;
  temp = suma + sumb - sqa - sqb;
  temp = (n - 1) * (sqa + sqb) - temp;
  cout << temp << "\n";
  return 0;
  ;
}
