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

int n, a, b;
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);
}

unsigned long long calc(int a, int b) {
    if (b - a <= 1) { return dist(points[a], points[b]); }
    int mid = (a + b) / 2;
    unsigned long long temp = 0;
    for (int i = a; i <= mid; ++ i) {
        for (int j = mid + 1; j <= b; ++ j) {
            temp += dist(points[i], points[j]);
        }
    }
    return temp + calc(a, mid) + calc(mid + 1, b);
}

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};
    }
    std::cout << calc(0, n - 1) << endl;
    return 0;
}
