N = int(input()) p = [0] * (N+6) for i in reversed(range(N)): p[i] = sum(p[i+1:i+7])/6 + 1 print(p[0])