module Main where

import Control.Monad

main :: IO()
main = do
  n <- read <$> getLine
  inputs <- map read <$> replicateM n getLine
  print . solve $ inputs

solve :: [Int] -> Int
solve inputs = head . filter (isAllDivable inputs ) $ [1..] where
  isAllDivable :: [Int] -> Int -> Bool
  isAllDivable is num = all (\i -> num `mod` i == 0) is
