#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++) {
            int x = point[i].first - point[j].first;
            int y = point[i].second - point[j].second;
            res += x * x + y * y;
        }
    }
    cout << res << endl;



    return 0;
}
