   program abc170a
      implicit none
      integer,dimension(5)::x
      integer::i

         read *, x(1:5)
         do i=1,5
            if ( x(i)==0 ) then
               print *, i
               stop
            end if
         end do

   end program abc170a