n=int(input())-1 print(bin(n).count("0")+n.bit_length()-1if n!=0else 0)