a = Array.new(206, 1.0) b = Array.new(206, 0.0) a[5] = 0 b[5] = 0 6.upto(205){|i| a[i] = a[(i - 6)..(i - 1)].inject(:+) / 6 b[i] = b[(i - 6)..(i - 1)].inject(:+) / 6 + 1 } n = gets.to_i if n <= 200 p b[n + 5] / (1 - a[n + 5]) else p n + 1 + 2.0 / 3 end