import Control.Applicative

main :: IO ()
main = do
  n <- readLn :: IO Int
  ns <- getInts
  print $ solve ns

getInts :: IO [Int]
getInts = map read . words <$> getLine

solve :: [Int] -> Int
solve (x:xs) = go xs x
  where
    go [] acc = acc
    go (n:ns) acc
      | gcd n acc == 1 = go ns (n * acc)
      | otherwise = go ((n `div` gcd n acc):ns) acc