using static System.Math; using System.Linq; using System.Collections.Generic; using System; public class Hello { static void Main() { var x = long.Parse(Console.ReadLine().Trim()); var m = (int)Sqrt(x) + 1; var a = GeneratePrime(m); var d = getDic(x, a); getAns(d); } static void getAns(Dictionary d) { var res = 1L; foreach (var x in d) { if (x.Value % 2 == 1) res *= x.Key; } Console.WriteLine(res); } static Dictionary getDic(long x, List a) { var acount = a.Count(); var d = new Dictionary(); for (int i = 0; i < acount; i++) { if (a[i] > x) break; while (true) { if (x % a[i] == 0) { if (d.ContainsKey(a[i])) d[a[i]]++; else d[a[i]] = 1; x /= a[i]; } else break; } } d[x] = 1; return d; } static List GeneratePrime(int m) { var a = new List(); int p; var sqrtMax = Math.Sqrt(m); var s = Enumerable.Range(2, m - 1).ToList(); do { p = s.First(); a.Add(p); s.RemoveAll(n => n % p == 0); } while (p < sqrtMax); a.AddRange(s); return a; } }