try: while True: n = int(input()) opt = bin(n)[2:] # bin()将数字转换成二进制的字符串前面带'0b' hex() 0f 十六进制 oct() 0o 八进制 print(opt.count('1')) except EOFError: pass