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



    return 0;
}
