open System let factorize n = let split p n = let mutable n = n let mutable k = 0L while n % p = 0L do k <- k + 1L n <- n / p (n, k) let f (p, n) = if p <= n then let (m, k) = split p n let elem = if k > 0L then Some (p, k) else None Some (elem, (p + 1L, m)) else None Seq.unfold f (2L, n) |> Seq.choose id |> Map.ofSeq let solve n = factorize n |> Map.toSeq |> Seq.choose (fun (k, v) -> if v % 2L <> 0L then Some k else None) |> Seq.fold (*) 1L [] let main _ = let x = Console.ReadLine() |> int64 printfn "%d" (solve x) //exit code 0