while True:
	try:
		n = int(input())
		b = [int(i) for i in bin(n)[2:]]
		print(sum(b))
	except:
		break