program main
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int32):: a(5),i


    read*, a(:)

    do i=1,5
        if (a(i)==0) then
            print'(i0)', i
            stop
        end if
    end do
end program main