#include<iostream>
using namespace std;
int main(){
int n;
while(cin >> n){
int count = 0;
while(n){
if(n % 2 == 1){
count++;
n = n / 2;
}else{
n = n / 2;
}
}
cout << count << endl;
}
return 0;
}
while True:
try:
n = int(input())
count = 0
while n:
if n % 2 == 1:
count += 1
n = n // 2
else:
n = n // 2
print(count)
except:
break