#include <iostream>
#include <algorithm>
using namespace std;
long long ans = 0, sum = 0, sqrs = 0;
int x[100000], y[100000];
int main () {
    ios_base::sync_with_stdio();
    cin.tie();
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> x[i] >> y[i];
    }

    sum = 0;
    sqrs = 0;
    for (int i = 0; i < n; i++) {
        sum += x[i];
        sqrs += x[i] * x[i];
    }
    ans += 2 * n * sqrs - 2 * sum * sum;

    sum = 0;
    sqrs = 0;
    for (int i = 0; i < n; i++) {
        sum += y[i];
        sqrs += y[i] * y[i];
    }
    ans += 2 * n * sqrs - 2 * sum * sum;

    cout << ans / 2;
    return 0;
}
