double x[999],q,s,t,w;i,k,j=3,u;main(v){for(gets(&q);~scanf("%lf",x+i);++i);for(;i;k?k-=!u*3,q=(x[u+j]-x[u+k])*(x[v+i]-x[v+k])-(x[v+j]-x[v+k])*(x[u+i]-x[u+k]),u=v,t+=q*(x[v=-~v%3]-x[v+k]),w+=q*q,u?:(s+=sqrt(t*t/w),t=w=0):(k=j-=3)?:(j=i-=3));printf("%f",s);}