program d
  implicit none
  integer,allocatable :: A(:),B(:)
  integer :: N,i,j,M,sm

  read(*,*) N
  allocate(A(N))
  read(*,*) A

  allocate(B(N))
  B=666
  do i=((N+1)/2),N
     B(i)=A(i)
  enddo
  do i=(N/2),1,-1
     sm=0
     do j=2,(N/i)
        sm=sm+B(j*i)
     enddo
     B(i)=mod(mod(A(i)-sm,2)+2,2)

  enddo
  !write(*,*) B                                                                 
  M=sum(B)
  write(*,'(i0)') M
  do i=1,N
     if(B(i).eq.1) then
        write(*,'(i0)',advance='no') i
        write(*,'(a)',advance='no') ' '
     endif
  enddo
  write(*,*)

end program d

