require 'prime'

def max(ary)
  result = 0
  ary.each_with_index do |val, idx|
    ary_tmp = ary.reject.with_index {|n, i| i == idx}

    result_ary = nil
    ary_tmp.each do |n|
      unless result_ary.nil?
        result_ary.delete_if do |res|
          n % res != 0
        end
      else
        result_ary = []
        (2..n).each do |i|
          result_ary << i if n % i == 0
          result_ary.delete_if {|a| Prime.prime?(a)}
        end
      end
    end
    result_tmp = result_ary.inject(1) {|sum, i| sum * i}
    result = result_tmp if result_tmp > result
  end

  return result
end

gets
ary = gets.split.map(&:to_i)
puts max(ary)
