#include <iostream>
#include <vector>
#include <utility>
#include <cstdlib>
#include <iostream>
#include <ctime>
using namespace std;
vector<pair<double, double>> test(vector<pair<double, double>> points, int number_points)
{
	for (int i = 0; i <= number_points; i++)
	{
		pair<int, int>p;
		p.first = rand() % 1000, p.second = rand() % 1000;
		p.first *= rand() % 2 == 0 ? 1 : -1, p.second *= rand() % 2 == 0 ? 1 : -1;
		//points[i].first = rand() % 1000, points[i].second = rand() % 1000;
		//points[i].first *= rand() % 2 == 0?1:-1, points[i].second *= rand() % 2 == 0 ? 1 : -1;
		points.push_back(p);
	}
	return points;
}
int calculate(int x, int y)
{
	return x * x + y * y;
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	unsigned int number_points = 1000, res = 0;
	vector<pair<double,double>> points;
	pair<double, double>point;
	//srand(time(0));
	//points = test(points, number_points);
	cin >> number_points;
	for (int i = 0; i < number_points; i++)
	{
		cin >> point.first >> point.second;
		points.push_back(point);
	}
	for (int i = 0; i < number_points; i++)
	{
		for (int j = i + 1; j < number_points; j++)
			res += calculate(points[i].first - points[j].first, points[i].second - points[j].second);
	}
	cout << res;
	return 0;
}