#include<bits/stdc++.h>
#define M 200002
using namespace std;
int A[M],Ans[M];
int main(){
	int n,ans=0;
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%d",&A[i]);
	for(int i=n;i>=n/2+1;i--)
		Ans[i]=A[i],ans+=A[i];
	for(int i=n/2;i>=1;i--){
		int num=0;
		for(int j=i*2;j<=n;j+=i)
			num+=Ans[j];
		num%=2;
		if(num!=A[i])Ans[i]=1;
		ans+=Ans[i];
	}
	printf("%d\n",ans);
	for(int i=1;i<=n;i++)if(Ans[i])printf("%d ",i);
	return 0;
}