import collections def solve(K): frontiers = {0: 1.0} pK = [0] * 6 dp = [0] * 6 if K <= 5: pK[K] = 1.0 for i in range(1, K + 1): new_frontiers = collections.defaultdict(float) for v, p in frontiers.items(): p6 = p / 6 for dv in range(1, 7): nv = v + dv if nv > K: continue if 5 >= K - nv: pK[K - nv] += p6 dp[K - nv] += i * p6 new_frontiers[nv] += p6 frontiers = new_frontiers a = sum((dp[i] + pK[i]) * (6 - i) for i in range(6)) b = 6 - sum(pK[i] * (6 - i) for i in range(1, 6)) return a / b - 1 K = int(input()) print(solve(K))