// Arup Guha
// 6/2/2026
// Solution to Going Nuts, using bitwise ops.
// 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) {

        // This also isolates the last bit.
        res += n&1;

        // This also divides by 2.
        n >>= 1;
    }

    cout << res << endl;
    return 0;
}
