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 result = List.fold_left (fun a x ->
    match a with
    | None -> Some x
    | Some r -> Some (lcm r x)
  ) None xs
  in
  match result with
  | None -> failwith "Something wrong"
  | Some r -> r

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

