#include <stdio.h>
#include <malloc.h>

struct point
{
    struct point* next;
    int x;
    int y;
};

long double sq_dist(struct point* a, struct point* b)
{
    return (a->x - b->x)*(a->x - b->x) + (a->y - b->y)*(a->y - b->y);
}

struct point* add_point(struct point* pnts, int x, int y)
{
    struct point* pnt = (struct point*)malloc(sizeof*pnt);
    pnt->x = x;
    pnt->y = y;
    if (pnts == NULL)
    {
        pnt->next = NULL;
        return pnt;
    }
    pnt->next = pnts;
    return pnt;
};

long long unsigned int points(int N)
{
    struct point* points = NULL;
    int x = 0,  y = 0;
    long long unsigned int res = 0;
    for(int i = N; i > 0; i--)
    {
        scanf("%d %d", &x, &y);
        points = add_point(points, x, y);
    }
    for(struct point* temp = points; temp != NULL; temp = temp->next)
        if (temp->next)
            for(struct point* temp2 = temp->next; temp2 != NULL; temp2 = temp2->next)
                res += sq_dist(temp, temp2);
    return res;
}

int main()
{
    int N = 0;
    scanf("%d", &N);
    printf("%d", points(N));
    return 0;
}
