let line;
while(line=readline()){
    let arr=parseInt(line).toString(2).split('');
    let num=0;
    arr.map(i=>{
        if(i===1||i==="1"){
            num++
        }
    })
    console.log(num)
}