// Arup Guha
// 6/2/2026
// Solution to Going Nuts
// https://open.kattis.com/problems/goingnuts

using namespace std;
#include <bits/stdc++.h>

int main() {

    int n;
    cin >> n;
    int res = 0;

    // Peel off bits and count.
    while (n > 0) {
        res += n%2;
        n /= 2;
    }

    cout << res << endl;
    return 0;
}
