k = int(input()) e = [0] * (k + 10) x = [0] * (k + 10) for i in range(k + 1, k + 6): x[i] = 1 for i in range(k)[::-1]: a = b = 0 for j in range(i + 1, i + 7): a += e[j] b += x[j] e[i] = a / 6 + 1 x[i] = b / 6 ans = e[0] / (1 - x[0]) print(ans)