#include <bits/stdc++.h>
using namespace std;
long long int pnt[100001][2];
long long int s1[100001];
long long int s2[100001];
int main() {
  long long int n;
  cin >> n;
  for (long long int i = 1; i <= n; i++) cin >> pnt[i][0] >> pnt[i][1];
  long long int sum = 0;
  for (long long int i = 1; i <= n; i++) s1[i] = s1[i - 1] + pnt[i][0];
  for (long long int i = 1; i <= n; i++)
    s2[i] = s2[i - 1] + pnt[i][0] * pnt[i][0];
  for (long long int i = 1; i <= n; i++) sum += (i - 1) * pnt[i][0] * pnt[i][0];
  for (long long int i = 1; i <= n; i++) sum -= 2 * pnt[i][0] * s1[i - 1];
  for (long long int i = 1; i <= n; i++) sum += s2[i - 1];
  for (long long int i = 1; i <= n; i++) s1[i] = s1[i - 1] + pnt[i][1];
  for (long long int i = 1; i <= n; i++)
    s2[i] = s2[i - 1] + pnt[i][1] * pnt[i][1];
  for (long long int i = 1; i <= n; i++) sum += (i - 1) * pnt[i][1] * pnt[i][1];
  for (long long int i = 1; i <= n; i++) sum -= 2 * pnt[i][1] * s1[i - 1];
  for (long long int i = 1; i <= n; i++) sum += s2[i - 1];
  cout << sum << endl;
  return 0;
}
