#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int> a(N+1);
  vector<int> b(N+1, 0);
  vector<int> res;
  for (int i = 1; i < N+1; i++) cin >> a[i];
  for (int i = N; i > 0; i--) {
    int tmp = 0;
    for (int j = i; j <= N; j+=i) {
      tmp += b[j];
    }
    if (tmp % 2 != a[i]) {
      b[i]++;
      res.push_back(i);
    }
  }
  reverse(res.begin(), res.end());
  cout << res.size() << endl;
  for (auto x: res) cout << x << " ";
}
