program roads;
var
i,j:longint;
l:extended;
n:longint;
x,y:array[1..5000]of extended;
q:array[1..5000]of extended;
p:array[1..5000]of longint;
o,max:extended;
begin
assign(input,'roadz.in');
reset(input);
assign(output,'roadz.out');
rewrite(output);
readln(n);
for i:=1 to n do
begin
readln(x[i],y[i]);
end;
for i:=1 to n do
begin
q[i]:=999999999999999;
p[i]:=1001;
end;
max:=0;
q[1]:=0;
j:=1;
l:=0;
while l<>9999999999 do
begin
p[j]:=0;
for i:=1 to n do
begin
if p[i]<>0 then
begin
o:=sqrt(sqr(x[j]-x[i])+sqr(y[j]-y[i]));
if o<q[i] then
begin
q[i]:=o;
p[i]:=j;
end;
end;
end;
l:=9999999999;
for i:=1 to n do
begin
if p[i]<>0 then
if q[i]<l then
begin
l:=q[i];
j:=i;
end;
end;
if l<>9999999999 then
max:=max+q[j];
end;
max:=round(max*100)/100;
writeln(max:0:2);
close(input);
close(output);
end.