//
// main.cpp
// poj2420
//
// Created by 陈加寿 on 16/2/13.
// Copyright © 2016年 chenhuan001. All rights reserved.
//
#include <iostream>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <algorithm>
using namespace std;
struct Point
{
int x,y;
}g[110];
#define eps 1e-6
double myrand()
{
long long a=rand();
long long b=rand();
a = a*b%200000-100000;
return ((double)a/10);
}
double fuc(double x,double y,int n)
{
double sum=0;
for(int i=0;i<n;i++)
sum += sqrt( (x-g[i].x)*(x-g[i].x)+(y-g[i].y)*(y-g[i].y) );//不是哈密顿距离
return sum;
}
double cold(int n)
{
double tx=0,ty=0;
double K=1;
double min=fuc(tx,ty,n);
while(K>eps)
{
double xx,yy;
xx=myrand()*K+tx;
yy=myrand()*K+ty;
double tmp=fuc(xx,yy,n);
if( tmp < min )
{
min=tmp;
tx=xx;
ty=yy;
}
K*=0.98;
}
return min;
}
int main(int argc, const char * argv[]) {
int n;
scanf("%d",&n);
for(int i=0;i<n;i++)
{
scanf("%d%d",&g[i].x,&g[i].y);
}
double ans = 1e9;
ans = min(ans,cold(n));
printf("%.0lf\n",ans);
return 0;
}