#include<iostream>
using namespace std;

int main() {

	long N; cin >> N;
	long A[200009]; for (int i = 1; i <= N; i++) cin >> A[i];
	bool inball[200009] = {}; long res = 0;

	for (int i = N; i >= 1; i--) {//iの倍数について考える。
		long link = 0;
		for (int j = 2; i * j <= N; j++) if (inball[i * j]) link++;

		if (link % 2 != A[i]) {inball[i] = true; res++;}
	}
	cout << res << endl;
	for (int i = 1; i <= N; i++) if (inball[i]) cout << i << " ";
}