#!/usr/bin/env pypy3 A = int(input()) def y_given_x(x, A): ret = 0 while x**ret < A: ret += 1 return ret s1 = 2*y_given_x(2, A) s2 = 3*y_given_x(3, A) print(min(s1, s2))