from math import ceil, log A = int(input()) result = float('inf') for i in range(2, 100): result = min(result, ceil(i * log(A, i))) print(result)