n=int(input()) b=int("{:b}".format(n)) count=0 sum=0 while b!=0: sum+=b%10 b=b//10 count+=1 if sum==1: print(count-1) else: print(count)