from math import ceil A = int(input()) ans = A for i in range(1,20000): a = ceil(A**(1/i)) ans = min(ans,a*i) print(ans)