#include <iostream>
#include <vector>
#include <utility>
using namespace std;
int calculate(int x, int y)
{
	return x * x + y * y;
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int number_points, res = 0;
	vector<pair<int,int>> points;
	pair<int, int>point;
	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;
}