N=bin(int(input())) ans =0 if N =="0b1":None elif "1" in str(N)[3:]: ans +=1 ans += len(str(N))-3 if ans<0:ans=0 print(ans)