program abc134d
   implicit none
   integer(8) :: n , i, ans, half, m
   integer(8), allocatable :: a(:), ball(:)

   read(*,*) n
   allocate(a(n), ball(n))
   read(*,*) a



   half = n/2 + 1

   if (a(half) == 0) then
      m = 0
      write(*,*) m
      stop
   else if (a(half) == 0) then
      m = 1
      write(*,*) m
      write(*,*) half
      stop
   endif

end
