def f(x: int, p: float, memo: dict) -> float: if x < 0: return p if x == 0: return 0 if x in memo: return memo[x] res = 0 for i in range(1, 7): res += (f(x-i, p, memo) + 1) / 6 memo[x] = res return res K = int(input()) lo = 1 hi = 1 << 60 ans = hi for i in range(100): p = (lo + hi) / 2 if f(K, p, {}) <= p: ans = min(ans, p) hi = p else: lo = p print(f'{ans:.10f}')