#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < N; i++) {
    cin >> a[i];
  }
  int M = 0;
  vector<int> b;
  for (int i = 1; i <= N; i++) {
    int count = 0;
    int j = i;
    while (j <= N) {
      count += a[j - 1];
      j += i;
    }
    if (count % 2 == a[i - 1] && count > 0) {
      M++;
      b.push_back(i);
    }
  }
  cout << M << endl;
  for (int i = 0; i < ((int)(b).size()); i++) {
    cout << b[i];
    if (i < ((int)(b).size()) - 1) {
      cout << " ";
    }
  }
  cout << endl;
  return 0;
}
