object Main extends App {
  var a = readInt
  var b = readLine.split(" ").map(_.toInt)
  var c,ans,s,tmp = 0
  var box = new Array[Int](a)
  
  for(i <- a-1 to 0 by -1) {
    c = i + 1
    for(j <- c - 1 until a by c) {
      tmp = tmp + box(j)
    }
    if(tmp %2!=b(i)) {
      ans = ans + 1
      box(i) = 1
    }
  }
  println(ans)
  for(i <- 0 until a) {
    if(box(i) == 1 && s != 0) {
      tmp = i + 1
      print(" " + tmp)
    }
    if(box(i) == 1 && s == 0) {
      tmp = i + 1
      print(tmp)
      s = s + 1
    }
  }
}