#include <iostream>
using namespace std;

constexpr int bitcount(const unsigned long long x, const int rez = 0){
	return ((bool)x) ? bitcount(x&x-1, rez+1) : rez; }

int main(){
	ios_base::sync_with_stdio(false);
	unsigned long long n;
	cin >> n;
	cout << bitcount(n);
	return 0; }