c = int(input()) now = 0 N = 1000 while 1: nxt = now + 1 t = nxt * nxt * nxt * nxt * nxt + nxt * N * N * N * N - c * N * N * N * N * N if t <= 0: now = nxt else: break if now >= 1000: t = now // 1000 now %= 1000 else: t = 0 ans = str(now / 1000) ans = ans + (5-len(ans)) * "0" if t: print(str(t) + ans[1:]) else: print(ans)