import math import sys from math import gcd from random import randint def is_prime(n): if n < 2: return False for p in [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]: if n % p == 0: return n == p d = n - 1 s = 0 while d % 2 == 0: d //= 2 s += 1 for a in [2, 325, 9375, 28178, 450775, 9780504, 1795265022]: if a >= n: continue x = pow(a, d, n) if x == 1 or x == n - 1: continue for _ in range(s - 1): x = pow(x, 2, n) if x == n - 1: break else: return False return True def pollards_rho(n): if n % 2 == 0: return 2 if n % 3 == 0: return 3 if n % 5 == 0: return 5 while True: c = randint(1, n - 1) f = lambda x: (pow(x, 2, n) + c) % n x, y, d = 2, 2, 1 while d == 1: x = f(x) y = f(f(y)) d = math.gcd(abs(x - y), n) if d != n: return d def factor(n): factors = {} for p in [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37]: while n % p == 0: factors[p] = factors.get(p, 0) + 1 n = n // p if n == 1: return factors def _factor(n): if n == 1: return if is_prime(n): factors[n] = factors.get(n, 0) + 1 return d = pollards_rho(n) _factor(d) _factor(n // d) _factor(n) return factors n = int(sys.stdin.readline()) if n == 1: print(1) else: factors = factor(n) exponents = list(factors.values()) current_gcd = exponents[0] for e in exponents[1:]: current_gcd = math.gcd(current_gcd, e) print(current_gcd)