K = int(input()) dp = [0] * (K + 1) for i in reversed(range(K)): E = 1 for j in range(1, 7): E += dp[min(K, i + j)] / 6.0 dp[i] = E print(dp[0])