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