#include using namespace std; unsigned int bitCount(unsigned int value) { unsigned int count = 0; while (value > 0) { if ((value & 1) == 1) count++; value >>= 1; } return count; } int main() { int p; cin >> p; cout << bitCount(p); //cin.get(); }