import java.util.*

fun main(args: Array<String>) {
    val scanner = Scanner(System.`in`)
    val n = scanner.nextInt()
    val a = Array(n, {0})
    val b = mutableListOf<Int>()
    val sum = Array(n, {0})
    var count = 0
    for(i in 0..n-1){
        a[i] = scanner.nextInt()
    }
    var index = n
    for(i in 0..n-1){
        if(sum[index-1] % 2 !== a[index-1]){
          b.add(index)
          count++
            var j=1
            while(j*j <= index){
                if(index%j === 0){
                    sum[j-1]++
                    if(j != index / j) sum[index/j-1]++
                }
                j++
            }
        }
        //else b[n-1-i] = 0
        index--
    }
    println(count)
    for(i in 0..b.size-1){
        print("${b[i]} ")
    }
}