N = int(input()) if N > 100: print(1) else: T = [1] + [0]*4 for n in range(N-1): for k in [4, 3, 2, 1]: T[k] = T[k]*((k+1)/6) + T[k-1]*((6-k)/6) T[0] = T[0]/6 print(1-sum(T))