#include <bits/stdc++.h>
using namespace std;

int main(){
  int N;
  cin>>N;
  vector<int> a(N+1);
  for(int i=1;i<=N;++i) cin>>a[i];
  vector<int> b(N+1);
  int cnt=0;

  for(int i=N;i>=1;--i){
    int sum=0;
    for(int j=2;j*i<=N;++j){
      sum +=  b[j*i];
    }
    b[i]=(sum-a[i]+2)%2;
    if(b[i]!=0) ++cnt;
  }
  
  cout<<cnt<<endl;
  for(int i=1;i<=N;++i){
    if(b[i]!=0) cout<<i<<endl;
  }
}