#N^M >= A import math A = int(input()) M1 = math.floor(math.log(A)) M2 = math.ceil(math.log(A)) N1 = math.ceil(A ** (1 / M1)) N2 = math.ceil(A ** (1 / M2)) print(min(M1 * N1, M2* N2))