n=int(input()) count=0 if n==1: print(0) exit() else: while n!=1: if n%2==0: n//=2 count+=1 else: n=(n+1)//2 count+=2 print(count)