#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const long long INF = mod * mod;
long long min(long long a, long long b) {
  if (a > b) {
    return b;
  } else {
    return a;
  }
}
long long max(long long a, long long b) {
  if (a > b) {
    return a;
  } else {
    return b;
  }
}
long long power(long long a, long long b) {
  long long ans = 1;
  for (long long i = 1; i <= b; i++) {
    ans *= a;
  }
  return ans;
}
long long gcd(long long m, long long n) {
  if (n == 0) {
    return m;
  }
  return gcd(n, m % n);
}
long long lcm(long long a, long long b) {
  long long g = gcd(a, b);
  return a / gcd(a, b) * b;
}
int main() {
  long long N;
  cin >> N;
  vector<long long> a(N);
  vector<bool> ans(N, false);
  long long M = 0;
  for (long long i = 0; i < (long long)(N); i++) {
    cin >> a[i];
  }
  for (long long i = N - 1; i >= 0; i--) {
    long long sum = 0;
    for (long long j = i; j < N; j++) {
      if (ans[j]) {
        sum++;
      }
      if (j + i < N) {
        j += i + 1;
      }
    }
    if (sum % 2 != a[i]) {
      ans[i] = true;
      M++;
    }
  }
  cout << M << endl;
  for (long long i = 0; i < (long long)(N); i++) {
    if (ans[i]) {
      cout << i + 1 << " ";
    }
  }
  cout << endl;
}
