#include <iostream>
#include <cmath>
using namespace std;
struct position{
    int x;
    int y;
};
position p[100010];
int main () {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n;
    int sum = 0;
    for (int i = 0; i < n; i++) {
        cin >> p[i].x >> p[i].y;
        for (int j = 0; j < i; j++) {
            sum += abs(p[i].x - p[j].x) * abs(p[i].x - p[j].x) + abs(p[i].y - p[j].y) * abs(p[i].y - p[j].y);
        }
    }
    cout << sum;
    return 0;
}

