local mce, mfl, msq, mmi, mma = math.ceil, math.floor, math.sqrt, math.min, math.max
local n = io.read("*n")
local a, t = {}, {}
for i = 1, n do
  a[i] = io.read("*n")
  t[i] = 0
end
for i = n, 1, -1 do
  local dst = a[i]
  local j = 2
  local cur = 0
  while j * i <= n do
    cur = cur + t[j * i]
    j = j + 1
  end
  cur = cur % 2
  t[i] = (a[i] + cur) % 2
end
local m = 0
for i = 1, n do
  if t[i] == 1 then m = m + 1 end
end
print(m)
for i = 1, n do
  if t[i] == 1 then print(i) end
end
