require "prime"

n = gets.to_i
numbers = gets.chomp.split.map(&:to_i)
table = Hash.new(0)
numbers.each{|x|
    Prime.prime_division(x).each{|p, x|
        table[p] = x if table[p] < x
    }
}
answer = 1
table.each{|k, v| v.times{answer *= k}}
puts answer
