#include <bits/stdc++.h>
using namespace std;
long long int mod(long long int a, long long int mod) {
  long long int res = a % mod;
  if (res < 0) res = res + mod;
  return res;
}
long long int modpow(long long int a, long long int n, long long int mod) {
  long long int res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}
long long int modinv(long long int a, long long int mod) {
  return modpow(a, mod - 2, mod);
}
bool is_prime(long long int n) {
  long long int i = 2;
  if (n == 1) return false;
  if (n == 2) return true;
  bool res = true;
  while (i * i < n) {
    if (n % i == 0) {
      res = false;
    }
    i = i + 1;
  }
  if (n % i == 0) res = false;
  return res;
}
vector<int> fact(int n) {
  vector<int> ans;
  for (long long int i = 0; i < (sqrt(n) + 1); i++) {
    if (n % i == 0) {
      ans.push_back(i);
    }
  }
  return ans;
}
int N;
int a[300000];
int answer[300000];
int cum[300000];
int main() {
  cin >> N;
  for (long long int i = 0; i < (N); i++) {
    cin >> a[i + 1];
  }
  int M = 0;
  for (int n = N; n >= 1; n--) {
    if (cum[n] == a[n]) {
      answer[n] = 0;
    } else {
      answer[n] = 1;
      M++;
      for (int i = 1; i <= n / 2 + 1; i++) {
        if (n % i == 0) {
          cum[i] += 1;
          cum[i] = cum[i] % 2;
        }
      }
    }
  }
  cout << M << endl;
  for (long long int ii = 0; ii < (N); ii++) {
    int i = ii + 1;
    if (answer[i] == 1) {
      cout << i << " ";
    }
  }
  return 0;
}
