import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Text.Read as T
import qualified Data.Array as A
import Data.List (intercalate)

main :: IO ()
main = do
  n <- unsafeSignedDecimal <$> T.getLine :: IO Int
  as <- A.listArray (1, n) . map ((== 1) . unsafeSignedDecimal) . T.words <$> T.getLine :: IO (A.Array Int Bool)
  let
    as' = A.listArray (1, n) . map f $ [1..n]
    f i | i == n = as A.! n
        | otherwise = foldr (/=) (as A.! i) . map ((as' A.!) . (i *)) $ [2..(n `div` i)]
    bs = filter (as' A.!) $ [1..n]
    m = length bs
  print m
  putStrLn . intercalate " " . map show $ bs

unsafeSignedDecimal :: T.Text -> Int
unsafeSignedDecimal s = case T.signed T.decimal s of
  Right (n, _) -> n
