#include <iostream>
#include <cmath>
using namespace std;

struct Point
{
    long double x;
    long double y;
};

double getDistance(Point p1, Point p2)
{
    return sqrt(pow(p1.x - p2.x, 2) + pow(p1.y - p2.y, 2));
}

int main()
{
    Point* points;
    double ans = 0;
    int N;

    cin >> N;
    points = new Point[100000];

    for (int i = 0; i < N; i++)
        cin >> points[i].x >> points[i].y;

    for (int i = 0; i < N - 1; i++)
        for (int j = i + 1; j < N; j++)
            ans += pow(getDistance(points[i], points[j]), 2);

    cout << ans << endl;
    delete points;

    return 0;
}
