n = int(input()) dp = [ 0.0 ] * (n + 6) dp[0] = 1.0 answer = 0 iters = 0 while sum(dp) > 1.0e-20: ndp = [ 0.0 ] * (n + 6) for i in range(n): for j in range(1, 7): ndp[i + j] += dp[i] / 6 for i in range(n + 1, n + 6): ndp[0] += ndp[i] ndp[i] = 0 dp = ndp.copy() iters += 1 answer += ndp[n] * iters print(answer)