let minDivsor n = seq{3L..n} |> Seq.takeWhile(fun x -> x*x<=n) |> Seq.where(fun x -> n%x=0L) |> Seq.tryHead let n = stdin.ReadLine() |> int64 n |> minDivsor |> function | Some(x) -> x | None -> match n%2L with | 0L when(n<>4L)-> n/2L | 0L when(n=4L) -> 4L | _ -> n |> printfn "%i"