program sample
	implicit none
    integer(8) :: x(5)
    
    read(*,*) x
    
    if (x(1) ==0) then
    	write(*,*) 1
    else if (x(2) ==0) then
    	write(*,*) 2
    else if (x(3) ==0) then
    	write(*,*) 3
    else if (x(4) ==0) then
    	write(*,*) 4
    else if (x(5) ==0) then
    	write(*,*) 5        
    end if
    stop
end program sample