#include<iostream>
using namespace std;
long long n,a[200010],b[200010],ans;
int main()
{
	cin>>n;
  
	for(int i=1;i<=n;i++)
		cin>>a[i];
  
	for(int i=n;i>=1;i--)	
	{
		int h=0;
      
		for(int j=2*i;j<=n;j += i)
			if(b[j]==1)
              
				h++;	
      
		if(h%2!=a[i])
		{
			b[i]=1;
			ans++;
		}		
	}
  
	cout<<ans<<endl;
  
	for(int i=1;i<=n;i++)
      
		if(b[i]==1)
			cout<<i<<" ";
  
	cout<<endl;	
  
} 
