#include <stdio.h>
int a[200001],b[200001];

int main(){
    int n;scanf("%d",&n);
    for (int i=1;i<=n;++i)scanf("%d",&a[i]);

    int m=0;
    for (int i=n;i>0;--i){
        int tmp=0;
        for (int j=2;j*i<=n;++j){
            if (b[j*i]) tmp++;
        }
        if (tmp%2!=a[i]) b[i]=1,++m;
        else b[i]=0;
    }

    printf("%d\n",m);
    for (int i=1;i<=n;++i)
    if (b[i]) printf("%d ",i);

}
