def f(n): for i in range(2, 131072 + 1): x = i ** n if x > 1000000000000: break t.append(1000000 / x) x = int(input()) t = [] for i in range(x, 32): f(i) t.sort() print(int(sum(t))) #t.extend([0] * (32 * 131072 - len(t))) #x = 1 #while x < 32 * 131072: # for i in range(0, 32 * 131072, x * 2): # t[i] += t[i + x] # x *= 2 #print(int(t[0]))