#include <bits/stdc++.h>
using namespace std;
int main() {
    int n;
    cin >> n;
    pair<int, int> point[n];
    int res = 0;
    for(int i = 0; i < n; i++) {
        cin >> point[i].first >> point[i].second;
        for(int j = 0; j < i; j++) {
            res += (point[i].first - point[j].first) * (point[i].first - point[j].first)
                    + (point[i].second - point[j].second) * (point[i].second - point[j].second);
        }
    }
    cout << res << endl;



    return 0;
}
