#include <bits/stdc++.h>
#define endl '\n'

int n, a, b;
unsigned long long ans;
std::pair<int, int> points[100001];

unsigned long long dist(std::pair<int, int> a, std::pair<int, int> b) {
    return (a.first - b.first) * (a.first - b.first) + (a.second - b.second) * (a.second - b.second);
}

int main() {
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(NULL);
    std::cin >> n;
    for (int i = 0; i < n; ++ i) {
        std::cin >> a >> b;
        points[i] = {a, b};
        for (int j = 0; j < i; ++ j) {
            ans += dist(points[i], points[j]);
        }
    }
    std::cout << ans << endl;
    return 0;
}
