k = int(input()) dp = [0]*(k+10) dp[k] = 0 for i in reversed(range(k)): dp[i] += 1 for j in range(1, 7): dp[i] += dp[i+j]/6 #print(dp) print(dp[0])