n = int(input())
ans = 10**9
for i in range(2, 1000):
    m = 0
    while (n**m < a):
        m += 1
    ans = min(ans, i * m)
print(ans)