#include <iostream> using namespace std; int main() { int num; while (cin >> num) { int res = 0; while (num){ if ((num & 1) == 1){ ++res; } num /= 2; } cout << res << endl; } return 0; }