program tenquestiontwo
 implicit none
 character(3) s
 integer i, n, res
 res = 0
 read(*,*) s
  do 10 i = 1,3
  read(s(i:i),*) n
   if (n.EQ.1) then
   res = res + 1
   end if
  10 continue
 write(*,*) res 
end program