(n,),*v = $<.map{|l|l.split.map &:to_i}
path = {}
v.each{|s,t|
  path[s]||=[]
  path[s]+=[t]
}
ans = 1e9
(1..n).each{|bl|
  dp = {n=>0.0}
  (n-1).downto(1){|i|
    nextpath = path[i].map{|t|dp[t]}.sort
    nextpath.pop if i==bl && nextpath[1]
    sum = 0
    nextpath.each{|j|
      sum += j
    }
	dp[i] = sum/nextpath.size + 1
  }
  ans = dp[1] if ans > dp[1]
}
p ans
