import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N = int(read()) dp = [0] * (N+1) # 残り距離 -> 回数 for n in range(1,N+1): left = n - 6 if left < 0: left = 0 dp[n] = 1 + sum(dp[left:n]) / 6 answer = dp[-1] print(answer)