#include <iostream>
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++) {
            int a = p[i].x - p[j].x;
            if (a < 0) {
                a *= -1;
            }
            int b = p[i].y - p[j].y;
            if (b < 0) {
                b *= -1;
            }
            sum += a * a + b * b;
        }
    }
    cout << sum;
    return 0;
}

