def fast_int(st, tens=None): E = 16 l = len(st) q, r = divmod(l, E) rs = [] for i in range(q): rs.append(int(st[l-(i+1)*E:l-i*E])) if r: rs.append(int(st[:r])) ten = 10 ** (E // 2) while len(rs) > 1: ten *= ten nexts = [] for i in range(len(rs) // 2): nexts += [rs[2 * i] + rs[2 * i + 1] * ten] if len(rs) & 1: nexts += [rs[-1]] rs = nexts return rs[0] def solve(): import sys for line in sys.stdin: print(bin(fast_int(line.rstrip())).count("1")) solve()