import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS
import Data.List

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
    [n, m] <- getIntList
    as <- getIntList
    let as' = map (`div` 2) as
    print $ sum [1 | x <- [1..m], and $ map (check x) as']

check x a = (x `mod` a == 0) && (odd (x `div` a))