n=int(input()) print(n.bit_length()//2+bin(n).count("1"))