#include<bits/stdc++.h>
using namespace std;
#define ll long long
const ll mod=1e9+7;
int a[200010],b[200010],ans[200010];
int main() {
	int n;
	scanf("%d",&n);
	for(int i=1; i<=n; i++)scanf("%d",a+i);
	for(int i=n;i>=1;i--){
		int cmp=0,kmp=0;
		for(int o=i;o<=n;o+=i)cmp+=a[o],kmp+=b[o];
		if(kmp%2==a[i])b[i]=0;
		else b[i]=1,ans[++ans[0]]=i;
	}
	sort(b+1,b+1+b[0]);
	printf("%d\n",ans[0]);
	for(int i=1;i<=ans[0];i++)printf("%d ",ans[i]);
}