program main
  implicit none
  integer i,N,i2,ball,j,t
  integer,allocatable :: a(:),b(:)
  !read(*, *) (L(i), i = 1,N)
  read(*, *) N
  allocate(a(N))
  allocate(b(N))
  read(*, *) (a(i), i = 1,N)
  t = 1
  do i = 1,N
    i2 = N-i+1
    ball = 0
    do j = 1,N/i2
      ball = ball+a(i2*j)
    end do
    !b(i2) = mod(ball,2)
    ball = mod(ball,2)
    if (ball == 1) then
      b(t) = i2
      t = t+1
    end if
  end do
  write(*, *) t-1
  if (t /= 1) then
    write(*, *) b(1:t-1)
  end if
end program main
