#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll n;
  cin >> n;
  vector<bool> a(n + 1);
  vector<bool> b(n + 1);
  vector<ll> out;
  for (ll i = 1; i <= n; i++) {
    ll x;
    cin >> x;
    if (x == 0)
      a[i] = false;
    else
      a[i] = true;
  }
  ll num = n / 2;
  for (ll i = num + 1; i <= n; i++) {
    b[i] = a[i];
  }
  for (ll i = num; i >= 1; i--) {
    ll cnt = 0;
    ll t = 3;
    for (ll j = 2 * i; j <= n; t++) {
      if (b[j] == true) cnt++;
      j = t * i;
    }
    if (cnt % 2 == 0) {
      if (a[i])
        b[i] = true;
      else
        b[i] = false;
    } else {
      if (a[i])
        b[i] = false;
      else
        b[i] = true;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (b[i]) out.push_back(i);
  }
  cout << out.size() << endl;
  if (out.size() > 0) {
    for (int i = 0; i < out.size(); i++) {
      if (i != 0)
        cout << ' ' << out[i];
      else
        cout << out[i];
    }
    cout << endl;
  }
  return 0;
}
