### constant

PI2 = Math::PI * 2

### main

loop do
  n = gets.to_i
  break if n == 0

  pts = n.times.map{gets.split.map(&:to_f)}
  visited = n.times.map{false}
  #p pts

  cx, cy, vx, vy = [0.0, 0.0, 0.0, 1.0]

  cnt = 0
  lsum = 0.0

  while cnt < n
    cth = Math.atan2(vy, vx)

    max_th = -10.0
    max_i = nil
    max_d2 = nil

    for i in (0...n)
      next if visited[i]

      px, py = pts[i]
      vx = px - cx
      vy = py - cy
      d2 = vx * vx + vy * vy
      th = Math.atan2(py - cy, px - cx)
      th -= PI2 if th > cth

      if max_th < th || max_th == th && max_d2 > d2
        max_th = th
        max_i = i
        max_d2 = d2
      end
    end

    visited[max_i] = true
    lsum += Math.sqrt(max_d2)
    cnt += 1

    vx = pts[max_i][0] - cx
    vy = pts[max_i][1] - cy
    cx, cy = pts[max_i]
  end

  puts "%.1f" % lsum
end