#include<stdio.h>
//#include<math.h>

struct Point{
    unsigned int x;
    unsigned int y;
};

int main(){


    int n, distancex, distancey, shortest, sum = 0;

    scanf("%d", &n);

    struct Point points[n];

    for(int i = 0; i<n; i++){
        scanf("%d", &points[i].x);
        scanf("%d", &points[i].y);
        //printf("///////////%d, %d\n", points[i].x, points[i].y);
    }

    for(int i = 0; i<n; i++){
        for(int j = i+1; j<n; j++){
            distancex = points[i].x - points[j].x;
            if(distancex<0){
                distancex = distancex * (-1);
            }
            //printf("x between %d and %d: %d\n", i, j, distancex);

            distancey = points[i].y - points[j].y;
            if(distancey<0){
                distancey = distancey * (-1);
            }
            //printf("y between %d and %d: %d\n", i, j, distancey);

            shortest = distancex * distancex + distancey * distancey;
            //printf("shortest: %d\n", shortest);

            sum = sum + shortest;
        }
    }

    printf("%d", sum);

    return 0;
}
