#include<stdio.h>
#include<math.h>

typedef struct{
  double x;
  double y;
  double rad;
}point;

int main(){
  int i,n;
  int x,y,nxt,psize,j;
  point ps[400];
  double d,min,dist,nx,ny;
  do{
    d=atan2(1.0,0.0);
    scanf("%d",&n);
    if(!n) break;
    for(i=0;i<n;i++){
      scanf("%d %d",&x,&y);
      ps[i].x=(double)x;
      ps[i].y=(double)y;
      ps[i].rad=d-atan2(ps[i].y,ps[i].x);
    }
    for(i=0,psize=n,dist=0.0,nx=0.0,ny=0.0;i<n;i++){
      for(j=1,nxt=0,min=ps[0].rad;j<psize;j++){
	if(ps[j].rad<min){
	  min=ps[j].rad;
	  nxt=j;
	}
      }
      dist+=sqrt((ps[nxt].x-nx)*(ps[nxt].x-nx)+
		 (ps[nxt].y-ny)*(ps[nxt].y-ny));
      d=atan2(ps[nxt].y-ny,ps[nxt].x-nx);
      nx=ps[nxt].x;
      ny=ps[nxt].y;
      for(j=0;j<psize;j++){
	ps[j].rad=d-atan2(ps[j].y-ny,ps[j].x-nx);
	if(ps[j].rad<0) ps[j].rad+=2*M_PI;
      }
      for(j=nxt+1;j<psize;j++){
	ps[j-1]=ps[j];
      }
      psize--;
    }
    printf("%.1lf\n",dist);
  }while(1);
  return 0;
}