def main(): n = input() n = int(n) # as multiple as possible i,j,k = 0,2,0 for a in range(0,10**10): # fix range if n <= a**2: i = a-1 break k = n - i**j return print(i+j+k) if __name__ == "__main__": main()