function main(input) {                                                                                                                                                                                 
    const args = input;                                                                                                                                                                                
    let a = parseInt(args, 10);                                                                                                                                                                        
    let c = 0;                                                                                                                                                                                         
    //console.log(a);                                                                                                                                                                                  
    if (a % 10 === 1) {                                                                                                                                                                                
        c+=1;                                                                                                                                                                                          
    }                                                                                                                                                                                                  
    a = Math.floor(a / 10);                                                                                                                                                                            
    //console.log(a);                                                                                                                                                                                  
    if (a % 10 === 1) {                                                                                                                                                                                
        c+=1;                                                                                                                                                                                          
    }                                                                                                                                                                                                  
    a = Math.floor(a / 10);                                                                                                                                                                            
   // console.log(a);                                                                                                                                                                                  
    if (a % 10 === 1) {                                                                                                                                                                                
        c+=1;                                                                                                                                                                                          
    }                                                                                                                                                                                                  
    console.log(c);                                                                                                                                                                                    
}                                                                                                                                                                                                      
                                                                                                                                                                                                       
main(require('fs').readFileSync('/dev/stdin', 'utf8'))    