import java.io.PrintWriter
import java.util.*

fun main(args: Array<String>) {
  val n = readLine()!!.toInt()
  val arr = readLine()!!.split(" ").map(String::toInt)
  val ans = mutableSetOf<Int>()
  for (i in n downTo 1) {
    var j = i * 2
    var m = 0
    while (j <= n) {
      if (ans.contains(j)) {
        ++m
      }
      j += i
    }
    m %= 2
    // debug(i, m)
    if (m != arr[i - 1]) {
      ans.add(i)
    }
  }
  println(ans.size)
  println(ans.toList().joinToString(separator = " "))
}

fun debug(vararg objs: Any) {
  System.err.println(Arrays.deepToString((objs)))
}