from math import comb def f(n: int) -> float: res = 0 for i in range(1, 6): # 出ない目の個数 cnt = comb(6, i) # どの目が出ないか sgn = 1 if i % 2 == 1 else -1 res += sgn * pow((6-i)/6, n) * cnt return 1 - res N = int(input()) ans = f(N) print(ans)