""" 1 - 1 -> 0 2 - 10 -> 1 3 - 11 -> 3 4 - 100 -> 2 5 - 101 -> 5 6 - 110 -> 4 7 - 111 -> 4 8 - 1000 -> 3 9 - 1001 -> 8 10 - 1010 """ def main(): N = int(input()) - 1 N_bin = bin(N)[2:] print(len(N_bin) + N_bin.count("0")) main()