#include <bits/stdc++.h>
using namespace std;
long long n;
int s=0;
long long const maxn = 10000;

struct Point
{
    int x;
    int y;
};

long long dist[maxn][maxn];
Point points[maxn];

void solve()
{
    for(int i=1;i<=n;i++)
    {
        for(int j = 1;j<=i;j++)
        {
            if(j==i)
                s+=0;
            else
                s+=dist[abs(points[i].x - points[j].x)][abs(points[i].y - points[j].y)];
        }
    }
}

int main()
{
    cin>>n;
    for(int i =0;i<=n;i++)
    {
        dist[0][i]=i*i;
    }
    for(int i=1; i<=n; i++)
    {
        cin>>points[i].x>>points[i].y;
        for(int j = 0;j<=n;j++)
            dist[i][j] = i*i+j*j;

    }
    solve();
    cout<<s;
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
}

