#include <iostream>

using namespace std;

int n, m;
int a[220000];
bool p[220000];

int main()
{
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  
  for (int i = n; i > 0; i--) {
    int sm = 0;
    for (int j = i; j <= n; j += i) {
      if (p[j]) sm++;
    }
    sm %= 2;
    if (a[i] != sm) {
      p[i] = true;
      m++;
    }
  }
  
  cout << m << endl;
  for (int i = 1; i <= n; i++) {
    if (p[i]) {
      cout << i << " ";
    }
  }
  return 0;
}