p = int(input()) n = p - 1 c = 0 m = n while m > 0: c += int(m % 2) m /= 2 print(c + 1)