function Main(input) {
	input = input.split("\n");
	const N = parseInt(input[0])
	const As = input[1].split(" ").map(x => parseInt(x))
	const boxs = new Array(N)
	boxs.fill(1)
	for(i=0; i < N; i++){
		var id = N-i
		var sum = 0
		for(j=1; j <= N/id; j++){
			sum = (sum + boxs[j*id-1]) % 2
		}
		if(sum != As[id-1]) boxs[id-1] = 0
	}
	var results = ""
	var count = 0
	for(i=0; i < N; i++){
		if(boxs[i] == 1){
			count++
			results += " " + (i+1)
		}
	}
	console.log(count)
	if(results != "") console.log(results.slice(1))
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));