#include <bits/stdc++.h>
#define MAX_N 100005
using namespace std;

int coordinates[2][MAX_N];

unsigned long long distance(int i, int j)
{
    int a=max(coordinates[0][i],coordinates[0][j])-min(coordinates[0][i],coordinates[0][j]);
    int b=max(coordinates[1][i],coordinates[1][j])-min(coordinates[1][i],coordinates[1][j]);
    unsigned long long d=pow(hypot(a, b),2);
    return d;
}


int main()
{
    ios_base::sync_with_stdio(false);
    int n;
    cin >> n;
    for(int i=0; i<n; i++)
    {
        cin >> coordinates[0][i];
        cin >> coordinates[1][i];
    }

    unsigned long long result=0;

    for(int i=0; i<n-1; i++)
    {
        for(int j=i+1; j<n; j++)
        {
            result+=distance(i, j);
        }
    }

    cout << result;


    return 0;
}
