import sys
#순서를 모르겠다

x=int(sys.stdin.readline())
cnt=0

while(x!=1):
    if((x-1)==1):
        x=x-1
    else:
        if((x-1)%
        if(x%3==0):
            x=x/3
        else:
            if(x%2==0):
                x=x/2
        
    cnt+=1
print(cnt)
