#include <bits/stdc++.h>
using namespace std;
long long n, a, b, sum1, sum2, ans1;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a >> b;
    sum1 += a;
    sum2 += b;
    ans1 += a * a + b * b;
  }
  cout << ans1 * n - (sum1) * (sum1) - (sum2) * (sum2) << endl;
  return 0;
}
