#include <iostream>
int main() {
int x, res = 0;
std::cin >> x;
while (x) {
x &= x - 1;
++res;
}
std::cout << res;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKaW50IG1haW4oKSB7CiAgICBpbnQgeCwgcmVzID0gMDsKICAgIHN0ZDo6Y2luID4+IHg7CiAgICB3aGlsZSAoeCkgewogICAgICAgIHggJj0geCAtIDE7CiAgICAgICAgKytyZXM7CiAgICB9CiAgICBzdGQ6OmNvdXQgPDwgcmVzOwp9Cg==