include <bits/stdc++.h>
using namespace std;
int main() {
stack<long long>a;
long long ans = 0, n;
cin >> n;
while (n >= 2) {
a.push(n % 2);
n /= 2;
}
a.push(n);
while (a.empty() == 0) {
if (a.top() == 1)
ans++;
a.pop();
}
cout << ans << endl;
return 0;
}