local n=io.read("*n")
local a={}
for i=1,n do
    a[i]=io.read("*n")
end

local box={}
for i=n,1,-1 do
    local ball=0
    for j=2*i,n,i do
        ball=ball+(box[j] or 0)
    end
    if ball%2~=a[i] then
        box[i]=1
    end
end

local counter=0
for i=1,n do
    if box[i] then
        counter=counter+1
    end
end
print(counter)
for i=1,n do
    if box[i] then
        print(i)
    end
end