def Operation(x): global K DP = [0] * (K+1) for i in range(1,K+1): for Dice in range(1,7): if i - Dice < 0: DP[i] += x else: DP[i] += DP[i-Dice] DP[i] = DP[i] / 6.0 + 1 return DP[K] K = int(input()) ng = 0 ok = 1e10 while ok - ng > 1e-3: x = (ok + ng) / 2 if Operation(x) >= x: ng = x else: ok = x print(ok)