n=int(input()) res=0 while n>1: if n%2==1: n+=1 res+=1 else: n=n//2 res+=1 print(res)