module global_variables
end module global_variables
program main
  use global_variables
  implicit none
  integer i,res
  character(3) s
  read *, s
  res = 0
  do i=1,3
    if (s(i:i) .eq. '1') then
      res = res + 1
    endif
  enddo
  print '(i0)', res
end program main
