K = int(input()) def check(m): dp = [1.0] * (K + 2) dp[-1] = m dp[K] = 0.0 for i in range(K - 1, -1, -1): for j in range(1, 7): dp[i] += dp[min(i + j, K + 1)]/6 return dp[0] <= dp[-1] yes = 1e6 no = 0 for _ in range(60): mid = (yes + no)/2 if check(mid): yes = mid else: no = mid print(yes)