#include <iostream>

using namespace std;

int main() {
	int x, k = 0;
	cin >> x;
	while ( x ) {
		x = x & (x-1);
		k++;
	}

	cout << k << '\n';
	return 0;
};