N=int(input()) ANS=0 while N!=1: if N%2==0: N//=2 ANS+=1 else: N+=1 ANS+=1 print(ANS)