#include<iostream>
using namespace std;
int main()
{
int n;
cin >> n;
int nr = 0;
while (n) nr ++, n &= n-1;
cout << nr << '\n';
return  0;
}