open Scanf

let ($) f g = f g

let factorize n =
  let s = sqrt $ float_of_int n in
  let n = ref n in
  let i = ref 2 in
  let xs = ref [] in
  while float_of_int !i <= s do
    while !n mod !i = 0 do
      xs := !i::!xs;
      n := !n / !i
    done;
    i := !i + 1
  done;
  if float_of_int !n > s then xs := !n::!xs;
  !xs

let rec gcd a b = 
  if b = 0 then a
    else gcd b (a mod b) 

let lcm a b =
  a * b / gcd a b

let multi_lcm xs =
  let merged = Hashtbl.create 100 in

  List.iter (fun x ->
    let fs = factorize x in
    (*
      print_endline $ String.concat ", " (List.map (fun x -> string_of_int x) fs);
    *)

    let tbl = Hashtbl.create (List.length fs) in

    List.iter (fun f ->
      if Hashtbl.mem tbl f then (
        let v = Hashtbl.find tbl f in
        Hashtbl.replace tbl f (v + 1)
      )
      else
        Hashtbl.add tbl f 1
    ) fs;

    Hashtbl.iter (fun k v ->
      if Hashtbl.mem merged k then (
        let max = Hashtbl.find merged k in
        if v > max then
          Hashtbl.replace merged k v
      )
      else
        Hashtbl.add merged k v
    ) tbl
  ) xs;

  Hashtbl.fold (fun k v a ->
    a * int_of_float (float_of_int k ** float_of_int v)
  ) merged 1

let _ =
  let n = scanf "%d\n" (fun x -> x) in
  let rec loop i xs =
    if i >= n then xs
    else (
      loop (i + 1) $ scanf "%d\n" (fun x -> x) :: xs
    ) in
  let xs = loop 0 [] in
  print_int $ multi_lcm xs

