#include <iostream>
#include <string>
#include <cstdio>
#include <cmath>

using namespace std;

int main(){
    int size;
    cin >> size;

    int x[size], y[size];
    int sum = 0;
    for(int i = 0; i < size; ++i){
        //cout << "test[" << i << "] ";
        scanf("%d %d", &x[i], &y[i]);
        //cout << x[i] << y[i] << endl;
    }

    /*
    for(int i = 0; i < size; ++i){
        if(x[i] == x[i + 1]){
            (abs(y[i+1])+abs(y[i])) * (abs(y[i+1])+abs(y[i]));
        }
        if(y[i] == y[i + 1]){
            (abs(x[i])+abs(x[i+1])) * (abs(x[i])+abs(x[i+1]));
        }

        int s1 = (abs(x[i])+abs(x[i+1]));
        int s2 = (abs(y[i+1])+abs(y[i]));
        sum += (s1*s1 + s2*s2);
    }
    */

    for(int i = 0; i < size; ++i){
        for(int j = i + 1; j < size; ++j){
            if(x[i] == x[j]){
                (y[j]-y[i]) * (y[j]-y[i]);
            }
            if(y[i] == y[j]){
                (x[i]-x[j]) * ((x[i])-(x[j]));
            }

            int s1 = (x[i]-x[j]);
            int s2 = (y[j]-y[i]);
            sum += (s1*s1 + s2*s2);
        }
    }

    cout << sum << endl;
    return 0;
}
