program main 
     implicit none
     integer a, b, c, d, e
     read(*, *) a, b, c, d, e
     
     if(a == 0)then
          write(*, *) 1
     else if (b == 0) then
          write(*, *) 2
     else if (c == 0) then
          write(*, *) 3
     else if (d == 0) then
          write(*, *) 4
     else if (e == 0) then
          write(*, *) 5
     endif 
     stop
end program main 
    
          