program main
    implicit none
    integer x1, x2, x3, x4, x5

    read(*,*) x1, x2, x3, x4, x5
    if (x1 == 0) then
        write(*,*) 1
    else if (x2 == 0) then
        write(*,*) 2
    else if (x3 == 0) then
        write(*,*) 3
    else if (x4 == 0) then
        write(*,*) 4
    else if (x5 == 0) then
        write(*,*) 5
    end if

end program
