#include <iostream>
using namespace std;

#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl;

int main()
{
    int N;

    cin >> N;
    int a[N + 1], box[N + 1] = {0};

    for (int i = 1; i <= N; i++)
    {
        cin >> a[i];
    }

    for (int i = N; i >= 1; i--)
    {
        int sum = 0;
        for (int j = 1; j <= N / i; j++)
        {
            if (box[i * j] == 1)
                sum += 1;
        }
        if (sum % 2 != a[i])
            box[i] = 1;
    }
    int M = 0;
    for (int i = 1; i <= N; i++)
    {
        if (box[i] == 1)
            M += 1;
    }

    OP(M)
    for (int i = 1; i <= M; i++)
    {
        if (box[i] == 1)
            OP(i)
    }

    return 0;
}