#include <iostream>
#include <vector>

using namespace std;

int main() {
int n = 0;
cin >> n;
vector<int> a(n+1);
for (int i=1; i<n+1; i++) {
 cin >> a.at(i);
}
vector<int> ans(n+1);
int sum = 0;
for (int i=n; i>=1; i--) {
 int count = 0, j = 2;
 while (i*j < n+1) {
  count += ans.at(i*j);
  j++;
 }
 if (count%2 != a.at(i)) {ans.at(i) = 1; sum++;}
}
cout << sum << endl;
for (int i=1; i<n+1; i++) {
 if (ans.at(i) == 1) cout << i << " ";
}
cout << endl;
return 0;
}
