K = int(input()) if K == 0: print(0) else: E = [0.0] * K for x in range(K-1, -1, -1): total = 0.0 for i in range(1, 7): next_x = x + i if next_x < K: total += E[next_x] E[x] = total / 6 + 1 print("{0:.5f}".format(E[0]))