
allLcm::[Int]->Int
allLcm an = foldl1 lcm an

main = do
  [n, m] <- map read . words <$> getLine
  an <- map read . words <$> getLine
  print $ (div m (allLcm $ map (`div` 2) an)) - (div m $ allLcm an)
