/* ACM ICPC Japan Domestic 99 Problem D: Spiral Footrace by Naoyuki Tamura (tamura@kobe-u.ac.jp) */ import java.io.*; import java.util.*; public class D { static boolean dbg = false; static DataInputStream in = new DataInputStream(System.in); static int N; static int x[]; static int y[]; static double d; static int x0, y0; static int x1, y1; static int next; static boolean visited[]; static void debug(String msg) { if (dbg) System.err.print(msg); } static boolean read() throws Exception { String line = null; debug("# Enter\n"); line = in.readLine(); N = Integer.parseInt(line); if (N == 0) return false; x = new int[N]; y = new int[N]; for (int i = 0; i < N; i++) { line = in.readLine(); StringTokenizer st = new StringTokenizer(line); x[i] = Integer.parseInt(st.nextToken()); y[i] = Integer.parseInt(st.nextToken()); } return true; } static double abs(int x, int y) { return Math.sqrt(x*x + y*y); } static boolean allRight(int i) { for (int j = 0; j < N; j++) { if (visited[j]) continue; if ((x[i]-x1)*(y[j]-y[i]) > (x[j]-x[i])*(y[i]-y1)) return false; } return true; } static boolean findNext() { double r0, r; r0 = Double.MAX_VALUE; for (int i = 0; i < N; i++) { if (! visited[i] && allRight(i)) { r = abs(x[i]-x1, y[i]-y1); if (r < r0) { next = i; r0 = r; } } } return r0 < Double.MAX_VALUE; } static void solve() throws Exception { visited = new boolean[N]; for (int i = 0; i < N; i++) visited[i] = false; d = 0.0; x0 = 0; y0 = -1; x1 = 0; y1 = 0; while (findNext()) { debug("# "+next+":("+x[next]+","+y[next]+")\n"); d += abs(x[next]-x1, y[next]-y1); visited[next] = true; x0 = x1; y0 = y1; x1 = x[next]; y1 = y[next]; } } public static void main(String args[]) { if (args.length > 0) dbg = true; try { while (read()) { solve(); d = Math.round(10 * d) / 10.0; System.out.println(d); } } catch (Exception e) { e.printStackTrace(); } } }