n = int(input()) ans = 1.0 sgn = -1 c = 6 for i in range(1,6)[::-1]: ans += sgn*c*((i/6)**n) sgn *= -1 c *= i c //= 7-i print(ans)