#include<iostream>
#include<cmath>
#include<queue>
using namespace std;
int main ()
{
    int sum=0, a=0, b=0;
    queue<long long>q;
    queue<long long>q2;
    long long N;
    cin>>N;
    for (int i=0; i<N; i++)
    {
        long long a, b;
        cin>>a>>b;
        q.push(a);
        q2.push (b);
    }
    queue<long long>q3=q;
    queue<long long>q4=q2;
    while (q3.empty()!=1)
    {
        int nachalo=q3.front();
        int nachalo2=q4.front();
        q=q3;
        q2=q4;
        while (q.empty()!=1)
        {
            q.pop();
            q2.pop();
            if (nachalo<0 and q.front()>0){
                a=q.front()-nachalo;
            }
            else a=nachalo-q.front();
            if (nachalo2<0 and q2.front()>0){
                b=q2.front()-nachalo2;
            }
            else a=nachalo2-q2.front();
            sum=sum+pow (a,2)+pow (b,2);
        }
        q3.pop();
        q4.pop();
    }
    cout<<sum;
    return 0;
}
