#include <bits/stdc++.h>

using namespace std;

#define x first
#define y second
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef long long ll;
typedef unsigned long long ull;

int main () {
#ifndef ONLINE_JUDGE
	ifstream fin("C:/Users/Adrian/Documents/mc/input.txt");
	#undef cin
	#define cin fin
#endif
	int a;

	scanf("%d", &a);
	

	int bc = 0;
	while(a) {				
		a = (a & (a - 1)); bc++;	
	}
	cout << bc;

	return 0;
}