N=int(input()) i=0 while N>1: if N%2==1: N+=1 else: N=N/2 i+=1 print('%d'%i)