def E(x): global K if dp[x] != -1: return dp[x] if x >= K: return 1.0 else: ret = 0.0 for i in range(1,6 + 1): ret += E(x + i) / 6 ret += 1 dp[x] = ret return dp[x] K = int(input()) dp = [-1 for i in range(K * 7 + 1)] print (E(0) - 1)