using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Numerics; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; using static System.Math; public static class P { public static void Main() { long x = long.Parse(Console.ReadLine()); Console.WriteLine(PrimeFactors(x).GroupBy(x => x).Where(x => x.Count() % 2 == 1).Aggregate(1L, (x, y) => x * y.Key)); } static IEnumerable PrimeFactors(long n) { while ((n & 1) == 0) { n >>= 1; yield return 2; } for (long i = 3; i * i <= n; i += 2) { while (n % i == 0) { n /= i; yield return i; } } if (n != 1) yield return n; } }