N = int(input()) 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]*(1/6) print(1-sum(T))