from functools import cache import sys sys.setrecursionlimit(10 ** 6) @cache def f(x: int) -> float: if x <= 0: return 0 res = 0 for i in range(1, 7): res += (f(x - i) + 1) / 6 return res K = int(input()) ans = f(K) print(ans)