program snuke
	implicit none
	!character(len=3) :: Masu
    integer ::i,j,Masu
    j=0
    read(*,*) Masu
  	do i=1,3
    	!write(*,*) mod(Masu/(10**(i-1)),10)
    	if(mod(Masu/(10**(i-1)),10)==1) then
     		j=j+1
        else
        endif
	end do   
    write(*,'(i0)') j
end program snuke