def f(n): t = [] for i in range(2, 10 ** 3): x = i ** n if x > 1000000000: break t.append(1000000 / x) return sum(result) x = int(input()) result = 1000000 for i in range(3, x): result -= f(i) print(result)