K = int(input()) dp = [0 for i in range(K * 7 + 1)] for i in range(K * 7): for j in range(1,6 + 1): if i - j < 0:continue dp[i] += dp[i - j] / 6 dp[i] += 1 print (dp[K - 1])