using System; using System.Collections.Generic; using System.Linq; static class Prime { public static List Sieve(int n) { var tab = new bool[n+1]; var ps = new List(); if (n >= 2) ps.Add(2); for (int i = 3; i <= n; i += 2) { if (!tab[i]) { // i is prime ps.Add(i); for (int j = i+i; j <= n; j += i) { tab[j] = true; } } } return ps; } } class Program { static string ReadLine() { return Console.ReadLine(); } static int ReadInt() { return int.Parse(ReadLine()); } static int[] ReadInts() { return ReadLine().Split().Select(int.Parse).ToArray(); } static string[] ReadStrings() { return ReadLine().Split(); } static void Main() { var x = long.Parse(ReadLine()); var primes = Prime.Sieve(1000000); var d = new Dictionary(); foreach (int p in primes) { if (p * p > x) break; while (x % p == 0) { if (!d.ContainsKey(p)) d[p] = 0; d[p]++; x /= p; } } if (x > 1) { if (d.ContainsKey(x)) d[x]++; else d[x] = 1; } long ans = 1; foreach (var k in d) { if (k.Value % 2 == 1) { ans *= k.Key; } } Console.WriteLine(ans); } }