#include <iostream>
#include <vector>

std::vector <std::pair <int, int> > v;

int up(int a)
{
    return a * a;
}

int sol(std::pair <int, int> a, std::pair <int, int> b)
{
    if (a.first == b.first) return up(std::max(a.second, b.second) - std::min(a.second, b.second));
    else if (a.second == b.second) return up(std::max(a.first, b.first) - std::min(a.first, b.first));
    else return up(std::max(a.second, b.second) - std::min(a.second, b.second)) + up(std::max(a.second, b.second) - std::min(a.second, b.second));
}

int main()
{
    std::ios::sync_with_stdio(0);
    std::cin.tie(0);
    int n;
    std::cin>>n;
    for (int  i = 0; i < n; ++i)
    {
        int a, b;
        std::cin>>a>>b;
        v.push_back({a, b});
    }
    int ans = 0;
    for (int i = 0; i < n; ++i)
    {
        for (int j = i + 1; j < n; ++j)
        {
            ans+=sol(v[i], v[j]);
        }
    }
    std::cout<<ans<<'\n';


    return 0;
}
