#include<bits/stdc++.h>
#pragma GCC optimize ("O3")
#define endl '\n'
using namespace std;
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    long long i,j,n,x,y,sumx=0,sumy=0, rez=0,pr=0,cur=0, kvx=0, kvy=0;

    cin>>n;

    for(i=0;i<n;i++)
    {
        cin>>x>>y;

        if(i==0){

            kvx+=x*x;
            kvy+=y*y;
            sumx+=x;
            sumy+=y;
            continue;
        }


        //cout<<i*(x*x+y*y+kvx+kvy)<<" "<<2*(sumx*x-sumy*y)<<" "<<kvx<<" "<<kvy<<" "<<sumx<<" "<<sumy<<endl;
        cur=i*(x*x+y*y)+kvx+kvy-2*(sumx*x + sumy*y);
        //cout<<cur<<endl;
        rez+=cur;
        pr=cur;

        sumx+=x;
        sumy+=y;
        kvx+=x*x;
        kvy+=y*y;

    }
        cout<<rez<<endl;

}

