let rec factriz i ls n = if i * i > n then n :: ls else if i = 2 then if n mod 2 = 0 then factriz i (i :: ls) (n / i) else factriz (i+1) ls n else if n mod i = 0 then factriz i (i :: ls) (n / i) else factriz (i+2) ls n let rec matchls n = function [] ->true |hd :: tl -> if n <> hd then matchls n tl else false let rec main ls ls1 = match ls with [] -> List.fold_left (fun x y -> x * y) 1 ls1 |hd :: tl -> if matchls hd ls1 = false then main tl (List.filter ((fun x y -> x <> y) hd) ls1) else main tl (hd :: ls1) let () = let n = int_of_string (read_line ()) in print_int (main (factriz 2 [] n) [])