#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long ans = 0;
  pair<long long, long long> p[n + 1];
  for (long long i = 1; i <= n; i++) {
    cin >> p[i].first >> p[i].second;
    ans = ans + (n - 1) * (p[i].first * p[i].first + p[i].second * p[i].second);
  }
  pair<long long, long long> sum[n + 1];
  sum[n].first = p[n].first, sum[n].second = p[n].second;
  for (long long i = n - 1; i >= 1; i--) {
    sum[i].first = p[i].first + sum[i + 1].first;
    sum[i].second = p[i].second + sum[i + 1].second;
  }
  for (long long i = 1; i < n; i++) {
    ans = ans + (-1) * (2) * (p[i].first) * (sum[i + 1].first) +
          (-1) * (2) * (p[i].second) * (sum[i + 1].second);
  }
  cout << ans << endl;
}
