program main
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int32):: ans,i
    character(3):: s
    read*, s
    ans=0
    do i=1,3
        if (s(i:i) == '1') ans=ans+1
    end do
    print'(i0)', ans
end program main