let minDivsor = function | 3L -> Some(3L) | 4L -> Some(4L) | 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 -> n/2L | _ -> n |> printfn "%i"