#include <stdio.h>
#include <stdlib.h>
int X[100000];
int Y[100000];
int find_dist(int x1, int y1, int x2, int y2)
{
    int a, b ,c;
    a = abs(x1-x2);
    b = abs(y1 - y2);
    if(a == 0)
        c = b * b;
    else if(b == 0)
        c = a * a;
    else
    {
        a *= a;
        b *= b;
        c = a + b;
    }
    return c;
}
int main()
{
    int n, sum = 0;
    scanf("%d", &n);
    for(int i = 0;i < n;i++)
    {
        scanf("%d", &X[i]);
        scanf("%d", &Y[i]);
    }
    for(int i = 0;i < n;i++)
    {
        for(int k = i + 1;k < n;k++)
        {
            sum += find_dist(X[i], Y[i], X[k], Y[k]);
        }
    }
    printf("%d\n", sum);
    return 0;
}
