#include <iostream>
using namespace std;
int main()
{
    int n = 1543, cnt = 0;
    while (n)
    {
        if (n & 1)
        {
            n--;
            cnt++;
            n /= 2;
        }
        else
            n /= 2;
    }
    cout << cnt << endl;
    return 0;
}
