#include <iostream>
#include<stdlib.h>
#include<cstring>
using namespace std;

int main()
{
    int n;
    std::cin>>n;
    int *x=(int*)malloc(n*sizeof(int)),*y=(int*)malloc(n*sizeof(int));
    for(int i=0;i<n;i++)
    {
        std::cin>>x[i]>>y[i];
    }
    int m[20000];
    memset(m,-1,20000);
    int xdiff,ydiff,xm,ym;
    int res=0;
    for(int i=0;i<n-1;i++)
    {
        for(int j=i+1;j<n;j++)
        {
            xdiff=x[i]-x[j];
            ydiff=y[i]-y[j];
            //if(m[xdiff]!=-1)xm=m[xdiff];
            //else xm=xdiff*xdiff,m[xdiff]=xm;
            //if(m[ydiff]!=-1)ym=m[ydiff];
            //else ym=ydiff*ydiff,m[ydiff]=ym;
            //xm=xdiff*xdiff,m[xdiff]=xm;
            //ym=ydiff*ydiff,m[ydiff]=ym;
            //res+=xm+ym;
            res+=xdiff*xdiff+ydiff*ydiff;
        }
    }
    std::cout<<res;
    return 0;
}
