int main()
{
int x, ans = 0;
cin >> x;
while(x)
{

x = x & (x - 1);
ans++;
}
cout << ans;