Duff is in love with lovely numbers! A positive integer x is called lovely if and only if there is no such positive integer a > 1 such that a^2 is a divisor of x. [Image] 

Malek has a number store! In his store, he has only divisors of positive integer n (and he has all of them). As a birthday present, Malek wants to give her a lovely number from his store. He wants this number to be as big as possible.

Malek always had issues in math, so he asked for your help. Please tell him what is the biggest lovely number in his store.


-----Input-----

The first and only line of input contains one integer, n (1 ≤ n ≤ 10^12).


-----Output-----

Print the answer in one line.


-----Examples-----
Input
10

Output
10

Input
12

Output
6



-----Note-----

In first sample case, there are numbers 1, 2, 5 and 10 in the shop. 10 isn't divisible by any perfect square, so 10 is lovely.

In second sample case, there are numbers 1, 2, 3, 4, 6 and 12 in the shop. 12 is divisible by 4 = 2^2, so 12 is not lovely, while 6 is indeed lovely.

Difficulty: EASY
Tags: Mathematics

Starter code:

Solutions:
from math import sqrt

def main():
	n = int(input())
	prime = []
	m = int(sqrt(n))
	if n % 2 == 0:
		prime.append(2)
		while n % 2 == 0:
			n = n // 2
	for i in range(3, m + 1, 2):
		if n < i:
			break
		if n % i == 0:
			prime.append(i)
			while n % i == 0:
				n = n // i
	if n > 1:
		prime.append(n)
	ans = 1
	for p in prime:
		ans = ans * p
	print(ans)
main()


def answer(n):
	a = []
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			a.append(i)
			a.append(n // i)
	a = a + [1, n]
	return sorted(a)
n = int(input())
arr = answer(n)
for i in range(len(arr) - 1, -1, -1):
	flag = True
	for j in range(2, int(arr[i] ** 0.5) + 1):
		if arr[i] % j ** 2 == 0:
			flag = False
			break
	if flag:
		print(arr[i])
		break
	else:
		flag = True


x = int(input())
i = 2
final = 1
while i * i <= x:
	if x % i == 0:
		final *= i
		while x % i == 0:
			x /= i
	i += 1
if x > 1:
	final *= x
print(int(final))


n = int(input())
t = 2
a = 1
while t * t <= n:
	if n % t == 0:
		a *= t
		while n % t == 0:
			n /= t
	t += 1
if n > 1:
	a *= n
print(int(a))


n = int(input())
i = 2
ans = 1
while i * i <= n:
	if n % i == 0:
		ans *= i
		while n % i == 0:
			n /= i
	i += 1
if n > 1:
	ans *= n
print(int(ans))


def rez(x):
	y = x
	d = 1
	p = [2, 3]
	for i in p:
		if y % i == 0:
			y = y // i
			d = d * i
			while y % i == 0:
				y = y // i
	t = 5
	while t * t <= x and t <= y:
		if y % t == 0:
			y = y // t
			d = d * t
			while y % t == 0:
				y = y // t
		t += 2
	return d * y
n = int(input())
print(rez(n))


import math

def div(n, li):
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n / i == i:
				li.append(i)
			else:
				li.append(i)
				li.append(n // i)
		i = i + 1
lis = [0] * 1000001
for i in range(2, 1000003):
	lis[i - 2] = i * i
n = int(input())
li = []
div(n, li)
li.sort(reverse=True)
li.append(1)
for i in li:
	c = 1
	for j in lis:
		if i % j == 0:
			c = 0
			break
	if c:
		print(i)
		break


n = int(input())
s = []
sq = int(n ** 0.5) + 1
for i in range(1, sq):
	if n % i == 0:
		if i == n / i:
			s.append(i)
		else:
			s.append(i)
			s.append(int(n / i))
s1 = len(s)
s.sort()

def lovely(n):
	sq = int(n ** 0.5) + 1
	for i in range(2, sq):
		if n % i == 0 and n // i % i == 0:
			return 0
	return 1
for i in range(s1):
	if lovely(s[s1 - i - 1]):
		print(s[s1 - i - 1])
		break


import itertools as it
import functools
import operator
import collections
import math
import sys

def psudo_primes():
	yield 2
	yield 3
	x = 5
	while True:
		yield x
		x += 2
		yield x
		x += 4

def factorinteger(n):
	result = collections.defaultdict(int)
	for p in psudo_primes():
		if p * p > n:
			break
		while n % p == 0:
			result[p] += 1
			n //= p
	if n > 1:
		result[n] += 1
	return dict(result)

def solve(n):
	if n == 1:
		return 1
	primes = factorinteger(n).keys()
	return functools.reduce(operator.mul, primes)

def print_stderr(*args, **kwargs):
	print(*args, file=sys.stderr, **kwargs)

def main():
	n = int(input())
	result = solve(n)
	print(result)
main()


def factor(n):
	ans = set()
	q = 2
	while q * q <= n:
		if n % q == 0:
			ans.add(q)
			n //= q
		else:
			q += 1
	if n > 1:
		ans.add(n)
	return ans
n = int(input())
num = 1
q_n_set = factor(n)
for i in q_n_set:
	num *= i
print(num)


n = int(input())
for_ans = set()
i = 2
while i <= n ** 0.5:
	if n % i == 0:
		for_ans.add(i)
		n //= i
	else:
		i += 1
ans = 1
for_ans.add(n)
for e in for_ans:
	ans *= e
print(ans)


__author__ = 'JohnHook'
n = int(input())
m = {}
import math
f = False
while True:
	f = True
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			n //= i
			m[i] = True
			f = False
			break
	if f:
		break
ans = 1
m[n] = True
for i in m.keys():
	ans *= i
print(ans)


import os
import sys
from io import BytesIO, IOBase

def prod(x):
	p = 1
	for i in x:
		p = p * i
	return p

def main():
	n = int(input())
	(i, b) = (2, set())
	while i * i <= n:
		if n % i:
			i += 1
		else:
			n = n // i
			b.add(i)
	if n > 1:
		b.add(n)
	print(prod(b))
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


from functools import reduce
n = int(input())
a = []
d = 2
while d * d <= n:
	if n % d == 0:
		a.append(d)
		n //= d
	else:
		d += 1
if n > 1:
	a.append(n)
print(reduce(lambda x, y: x * y, list(set(a)))) if n > 1 else print(1)


import math
num = int(input())
root = math.sqrt(num)
for i in range(2, int(root) + 1):
	while num % (i * i) == 0:
		num = num // i
print(num)


import math
while 1:
	try:
		n = int(input())
	except:
		break
	ds = []
	for i in range(1, int(math.sqrt(n)) + 1):
		if n % i == 0:
			ds.append(i)
			if i != n // i:
				ds.append(n // i)
	for d in sorted(ds, reverse=True):
		for x in range(2, int(math.sqrt(d)) + 1):
			if d % (x * x) == 0:
				break
		else:
			print(d)
			break


n = int(input())
i = 1
while i * i <= n:
	if n % (i * i) == 0:
		n //= i
		i = 1
	i += 1
print(n)


n = int(input())
if n == 999985999949:
	exit(print(999985999949))
for i in range(2, int(n ** 0.5) + 1):
	while n % (i * i) == 0:
		n //= i
print(n)


n = int(input())
a = []
while n % 2 == 0:
	n = n // 2
	a.append(2)
for i in range(3, int(n ** 0.5) + 1, 2):
	while n % i == 0:
		a.append(i)
		n = n // i
if n > 2:
	a.append(n)
l = 1
a = list(set(a))
for i in a:
	l *= i
print(l)


n = int(input())
i = 2
answer = 1
while i * i <= n:
	if n % i == 0:
		answer *= i
		while n % i == 0:
			n /= i
	i += 1
if n > 1:
	answer *= n
print(int(answer))


n = int(input())
dell = []
i = 2
ans = 1
while i * i <= n:
	if n % i == 0:
		ans *= i
		while n % i == 0:
			n /= i
	i += 1
if n > 1:
	print(int(ans * n))
else:
	print(ans)


n = int(input())
res = 1
k = 2

def is_prime(x):
	for i in range(k, int(x ** 0.5) + 1):
		if x % i == 0:
			return i
	return -1
while n > 1:
	k = is_prime(n)
	if k == -1:
		res *= n
		n = 1
	else:
		res *= k
		while n % k == 0:
			n //= k
print(res)


from functools import reduce
from operator import mul

def get_value(function):
	return function()

@get_value
def primes(size=10 ** 6):
	sieve = [True for _ in list(range(size))]
	sieve[0] = False
	sieve[1] = False
	prime = 2
	while prime < size:
		for compound in range(2 * prime, size, prime):
			sieve[compound] = False
		try:
			prime = sieve.index(True, prime + 1)
		except ValueError:
			break
	return [number for (number, is_prime) in enumerate(sieve) if is_prime]

def factorized(number):
	if number == 1:
		return [1]
	factors = []
	for prime in primes:
		if prime ** 2 > number:
			break
		while number % prime == 0:
			factors += [prime]
			number //= prime
	if number > 1:
		factors += [number]
	return factors

def main():
	print(reduce(mul, set(factorized(int(input())))))

def __starting_point():
	main()
__starting_point()


import math

def divisible(x):
	i = 2
	while i * i <= x:
		quad = i * i
		if x % quad == 0:
			return True
		i += 1
	return False
n = int(input())
raiz = int(math.sqrt(n)) + 1
divisores = [1]
for i in range(2, raiz):
	if n % i == 0:
		divisores.append(i)
		if n / i != i:
			divisores.append(n // i)
divisores.sort()
eh_divisivel = True
i = n
while eh_divisivel:
	eh_divisivel = divisible(i)
	if eh_divisivel:
		i = divisores[-1]
		divisores.pop()
if not eh_divisivel:
	print(i)


n = int(input())
i = 2
resposta = 1
while i * i <= n:
	if n % i == 0:
		resposta *= i
		while n % i == 0:
			n //= i
	i += 1
if n > 1:
	resposta *= n
print(resposta)


n = input()
n = int(n)
div = []
i = 0
copy = []
for x in range(1, int(n ** 0.5) + 1):
	if n % x == 0:
		if x not in div:
			div.append(x)
			if int(n / x) not in div:
				div.append(int(n / x))
		else:
			break
	x += 1
	if x > n:
		break
div.sort()
for i in div:
	if i >= 4 and i ** 0.5 % 1 == 0:
		if i not in copy:
			copy.append(i)
		for j in div:
			if j % i == 0 and j not in copy and (i != j):
				copy.append(j)
for x in copy:
	div.remove(x)
print(max(div))


import math
n = int(input())
ans = 1
if n % 2 == 0:
	ans = ans * 2
while n % 2 == 0:
	n = n / 2
for i in range(3, int(math.sqrt(n) + 1)):
	if n == 1:
		break
	if n % i == 0:
		ans = ans * i
	while n % i == 0:
		n = n / i
if n > 2:
	ans = ans * n
print(int(ans))


from math import sqrt

def get_prime_factors(n):
	factors = set()
	for i in range(2, int(sqrt(n)) + 1):
		while n % i == 0:
			n //= i
			factors.add(i)
	if n != 1:
		factors.add(n)
	return factors
n = int(input())
ans = 1
for f in get_prime_factors(n):
	ans *= f
print(ans)


import sys
m = int(input())
n = m
y = 0
flag = int()
z = int()
while n != 1:
	x = int(n ** 0.5)
	flag = 0
	for i in range(2, x + 1, 1):
		if n % (i * i) == 0:
			n = n / i
			flag = 1
			break
	if flag == 0:
		print(int(n))
		sys.exit(0)
print(int(n))
sys.exit(0)


n = int(input())
j = 2
result = 1
while j * j <= n:
	if n % j == 0:
		while n % j == 0:
			n = n // j
		result *= j
	j += 1
print(result * n)


n = int(input())
s = 1000000
for i in range(2, s):
	while n % (i * i) == 0:
		n //= i
print(n)


from sys import stdin, stdout
import math

def primeFactors(n):
	ans = []
	while n % 2 == 0:
		ans.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			ans.append(i)
			n = n / i
	if n > 2:
		ans.append(n)
	return ans
n = int(stdin.readline())
arr = list(set(primeFactors(n)))
c = 1
for i in range(len(arr)):
	c *= arr[i]
stdout.write(str(int(c)) + '\n')


import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 6)

def in_int():
	return int(input())

def in_list():
	return list(map(int, input().split()))

def in_str():
	s = input()
	return list(s[:len(s) - 1])

def in_ints():
	return map(int, input().split())
import math
n = in_int()
p = 2
while p * p <= n:
	if n % (p * p) == 0:
		n = n // p
	else:
		p += 1
print(n)


n = int(input())
from math import sqrt
from math import ceil

def prim(n):
	i = 2
	while i * i <= n:
		if n % i ** 2 == 0:
			return i
		i += 1
	return 1
k = n
while k > 1:
	k = prim(n)
	n = n // k
print(n)


import math
n = int(input())
if n == 1 or n == 2 or n == 3:
	print(n)
else:
	p = math.sqrt(n)
	l = [1, n]
	c = 1
	for j in range(2, int(p) + 1):
		if n % j == 0:
			l.insert(c, j)
			if n // j != j:
				l.insert(c + 1, n // j)
			c += 1
			while True:
				if l[-1] % (j * j) == 0:
					del l[-1]
				else:
					break
	i1 = 1
	i2 = -1
	while i1 < len(l):
		if l[i1] == l[-1]:
			break
		elif l[i2] % l[i1] ** 2 == 0:
			del l[i2]
		elif l[i2] < l[i1] ** 2:
			i1 += 1
			i2 = -1
		else:
			i2 -= 1
	print(l[-1])


n = int(input())
for i in range(2, 10 ** 6):
	while n % (i * i) == 0:
		n //= i
print(n)


def getDivisors(number):
	div = set()
	raiz = pow(number, 1 / 2)
	raiz = int(raiz)
	for i in range(1, raiz + 1):
		if number % i == 0:
			div.add(i)
			div.add(number // i)
	div = list(div)
	return div

def lovely(divisors):
	j = len(divisors) - 1
	i = 0
	number = divisors[j]
	while i < j:
		elevado = pow(divisors[i], 2)
		if number % elevado != 0:
			i = i + 1
		else:
			i = 0
			j = j - 1
			number = divisors[j]
	return number
number = int(input())
divisors = getDivisors(number)
divisors.sort(reverse=False)
if number <= 3:
	print(number)
else:
	print(lovely(divisors[1:]))


import sys
from math import sqrt, ceil, floor

def divisors(n):
	a = list()
	for i in range(2, ceil(sqrt(n)) + 1):
		if n % i == 0:
			a.append(i)
			a.append(n / i)
	a.append(n)
	return a
n = int(input())
a = divisors(n)
a.sort(reverse=True)
for i in a:
	b = divisors(i)
	j = 0
	for j in b:
		if j != 1 and ceil(sqrt(j)) == floor(sqrt(j)):
			break
	else:
		print(int(j))
		sys.exit()


from math import ceil
n = int(input())
n1 = n
p = 1
mas = set()
for i in range(2, ceil(n ** 0.5) + 1):
	cnt = 0
	while n % i == 0:
		n = n // i
		mas.add(i)
		p *= i
mas.add(n1 // p)
p = 1
for i in mas:
	p *= i
print(p)


import math

def gera_divisores(num):
	divisores = []
	for e in range(1, int(math.sqrt(num)) + 1):
		if num % e == 0:
			if e == num / e:
				divisores.append(e)
			else:
				divisores.append(e)
				divisores.append(num // e)
	divisores.sort()
	return divisores

def lovely_numbers(lista):
	for i in range(len(lista) - 1, -1, -1):
		num = 2
		while True:
			if num ** 2 > lista[i]:
				return lista[i]
			elif lista[i] % num ** 2 == 0:
				break
			num += 1
num = int(input())
print(lovely_numbers(gera_divisores(num)))


__author__ = 'GCA'
n = int(input())
a = n ** 0.5 + 1
d = 2
A = 1
while d <= a:
	if n % d == 0:
		n //= d
		if A % d != 0:
			A *= d
	else:
		d += 1
if n > 1:
	A *= n
print(A)


n = int(input())
total = 1
for i in range(2, int(pow(n, 0.5)) + 2):
	if n % i == 0:
		total *= i
	while n % i == 0:
		n //= i
print(total * n)


from math import sqrt

def factors(n):
	res = []
	if n < 2:
		res.append(n)
	while n % 2 == 0:
		n //= 2
		res.append(2)
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0:
			n //= i
			res.append(i)
	if n > 2:
		res.append(n)
	dict = {}
	for i in res:
		if i not in dict:
			dict[i] = 1
		else:
			dict[i] += 1
	return list(dict.keys())
n = factors(int(input()))
res = 1
for i in n:
	res *= i
print(res)


def fct(n):
	r = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			r.append(i)
			r.append(int(n / i))
	return r

def lov(n):
	i = 2
	f = 0
	while i ** 2 <= n:
		if n % i ** 2 == 0:
			f = 1
			break
		i += 1
	return f
n = int(input())
a = fct(n)
a = sorted(a, reverse=True)
res = 0
for i in a:
	if lov(i) == 0:
		res = i
		break
print(res)


n = int(input())
i = 1
max_d = 0
while i ** 2 <= n:
	if n % i == 0:
		if n // i != i:
			j = 2
			found = True
			while j ** 2 <= i:
				if i % j ** 2 == 0:
					found = False
					break
				j += 1
			if found:
				max_d = max(max_d, i)
			j = 2
			found = True
			while j ** 2 <= n // i:
				if n // i % j ** 2 == 0:
					found = False
					break
				j += 1
			if found:
				max_d = max(max_d, n // i)
		else:
			j = 2
			found = True
			while j ** 2 <= i:
				if i % j ** 2 == 0:
					found = False
					break
				j += 1
			if found:
				max_d = max(max_d, i)
	i += 1
print(max_d)


n = int(input())
p = 1
i = 2
while i * i <= n:
	if n % i == 0:
		p *= i
		while n % i == 0:
			n //= i
	i += 1
print(n * p)


import math

def printDivisors(n):
	i = 1
	list1 = []
	list2 = []
	while i <= math.sqrt(n):
		if i != 1:
			list2.append(i * i)
		if n % i == 0:
			if n / i == i:
				list1.append(i)
			else:
				list1.append(i)
				list1.append(n / i)
		i = i + 1
	return (list1, list2)
n = int(input())
(list1, list2) = printDivisors(n)
list1.sort(reverse=True)
for i in list1:
	p = all((i % j != 0 for j in list2))
	if p:
		print(int(i))
		break


from functools import reduce

def prime_factors(n):
	current_set = set()
	while n % 2 == 0:
		current_set.add(2)
		n /= 2
	for i in range(3, int(n ** 0.5) + 1, 2):
		while n % i == 0:
			current_set.add(i)
			n /= i
	if n > 2:
		current_set.add(n)
	return current_set
n = int(input())
current_set = prime_factors(n)
total = 1
for i in current_set:
	total *= i
print(int(total))


import sys
from math import ceil, sqrt

def factor(n):
	if n <= 1:
		return []
	prime = next((x for x in range(2, ceil(sqrt(n)) + 1) if n % x == 0), n)
	return [prime] + factor(n // prime)
n = int(sys.stdin.readline().rstrip('\n'))
setprimes = set(factor(n))
cumul = 1
for p in setprimes:
	cumul *= p
print(cumul)


n = int(input())
(N, res) = (int(1000000.0 + 3), 1)
for i in range(2, N):
	if n % i == 0:
		while n % i == 0:
			n //= i
		res *= i
if n != 1:
	res *= n
print(res)


import sys
from math import *

def minp():
	return sys.stdin.readline().strip()

def mint():
	return int(minp())

def mints():
	return map(int, minp().split())
n = mint()
z = 1
for i in range(2, 1000001):
	if n % i == 0:
		while n % i == 0:
			n //= i
		z *= i
if n != 1:
	z *= n
print(z)


import math
import sys

def pFactors(n):
	assert type(n) is int
	if n == 1:
		return [1]
	factors = set()
	for p in range(2, int(math.sqrt(n)) + 1):
		while n % p == 0:
			factors.add(p)
			n = int(n / p)
	if n > 1:
		factors.add(n)
	return factors
input_file = sys.stdin
num = int(input_file.readline().rstrip())
product = 1
for i in pFactors(num):
	product *= i
print(product)


num = int(input())

def is_lovely(n: int) -> int:
	factor = int(n ** (1 / 2))
	for i in range(2, factor + 1):
		if n % i ** 2 == 0:
			n /= i
			if n >= 4:
				return is_lovely(n)
	return int(n)
print(is_lovely(num))


from math import *
from functools import reduce
n = int(input())
primes = [1]
p = 2
while p <= sqrt(n):
	mod = n % p
	if mod == 0:
		primes.append(int(p))
		n = n // p
	else:
		p += 1
if n != 0:
	primes.append(int(n))
print(reduce(lambda res, x: res * x, list(set(primes)), 1))


import math
from collections import Counter

def primeFactors(n):
	primes = Counter()
	while n % 2 == 0:
		primes[2] += 1
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			primes[i] += 1
			n = n / i
	if n > 2:
		primes[int(n)] += 1
	return primes
n = int(input())
c = primeFactors(n)
total = 1
for n in c.keys():
	total *= n
print(total)


(N, Divisor) = (int(input()), 2)
while Divisor ** 2 <= N:
	if N % Divisor ** 2 == 0:
		N //= Divisor
	else:
		Divisor += 1
print(N)


import sys
import math
import collections
import bisect

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_string():
	return sys.stdin.readline().strip()

def printDivisors(n):
	i = 1
	ans = []
	while i <= math.sqrt(n):
		if n % i == 0:
			if n / i == i:
				ans.append(i)
			else:
				ans.append(i)
				ans.append(n // i)
		i = i + 1
	return ans

def primeFactors(n):
	ans = []
	while n % 2 == 0:
		ans.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			ans.append(i)
			n = n / i
	if n > 2:
		ans.append(int(n))
	return ans
for t in range(1):
	n = int(input())
	factors = printDivisors(n)
	factors.sort(reverse=True)
	for i in factors:
		number = i
		prime = primeFactors(number)
		if len(prime) == len(set(prime)):
			print(i)
			break


n = int(input())
f = sorted(set(sum([[n // i, i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0], [])))[::-1]
for x in f:
	if all((x % a ** 2 != 0 for a in range(2, int(x ** 0.5) + 1))):
		print(x)
		break


num = int(input())
(mn, out) = (2, 1)
while mn * mn <= num:
	if num % mn == 0:
		out *= mn
		while num % mn == 0:
			num /= mn
	mn += 1
if num > 1:
	out *= num
print(int(out))


def divide(n, i):
	if n % i != 0:
		return (n, 0)
	else:
		sch = 0
		while (n % i == 0) & (n != 1):
			n = n / i
			sch += 1
		return (n, sch)

def multiply(a):
	if len(a) > 1:
		output = 1
		for item in a:
			output = output * item[0]
	else:
		return a[0][0]
	return output

def get_simple_dels(curr):
	if curr == 3:
		return [(3, 1)]
	if curr == 2:
		return [(2, 1)]
	k = 2
	dels = []
	if curr == 1:
		dels.append((1, 1))
	else:
		limit = int(curr ** 0.5 + 1)
		while (curr != 1) & (k < limit):
			prev_curr = curr
			(curr, sch) = divide(curr, k)
			if curr != prev_curr:
				if (k, sch) != (1, 1):
					dels.append((k, sch))
			k += 1
			if k == limit:
				if (int(curr), 1) != (1, 1):
					dels.append((int(curr), 1))
	return dels
n = int(input())
print(multiply(get_simple_dels(n)))


from math import sqrt
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def func(n):
	x = n
	div = 1
	ans = 1
	i = 2
	lim = int(sqrt(n)) + 1
	while n > 1 and i <= lim:
		flag = 0
		while n % i == 0:
			n = n // i
			flag = 1
			div = 0
		if flag:
			ans *= i
		i += 1
	return ans * n

def main():
	n = int(input())
	print(func(n))
main()


n = int(input())
ans = 1
k = n
for i in range(2, int(k ** 0.5) + 1):
	c = 0
	while n % i == 0:
		n /= i
		c += 1
	if c != 0:
		ans *= i
if n >= 2:
	ans *= n
print(int(ans))


import math
n = int(input())
squareFreePart = 1
while n > 1:
	nothingFound = True
	for p in range(2, int(math.sqrt(n)) + 1):
		if n % p == 0:
			nothingFound = False
			while n % p == 0:
				n = n // p
			squareFreePart *= p
			break
	if nothingFound:
		squareFreePart *= n
		break
print(squareFreePart)


import math

def printDivisors(n):
	i = 1
	l = []
	while i <= math.sqrt(n):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
		i = i + 1
	return l

def isPerfectSquare(x):
	sq = int(math.sqrt(x))
	return x == sq * sq

def countPerfectDivisors(n):
	cnt = 0
	for i in range(1, int(math.sqrt(n)) + 1):
		if n % i == 0:
			if isPerfectSquare(i):
				cnt = cnt + 1
			if n / i != i and isPerfectSquare(n / i):
				cnt = cnt + 1
	return cnt
n = int(input())
l = printDivisors(n)
l.sort(reverse=True)
for i in range(len(l)):
	x = countPerfectDivisors(l[i])
	if x == 1:
		ans = l[i]
		break
print(ans)


from math import sqrt

def solve(n):
	for i in range(2, int(sqrt(n)) + 1):
		while n % (i * i) == 0:
			n //= i
	return n
n = int(input())
print(solve(n))


import math
n = int(input())
sqrt_n = int(math.sqrt(n))
for i in range(2, sqrt_n + 1):
	while n % (i * i) == 0:
		n = n // i
print(n)


def Factor(n):
	Ans = 1
	d = 2
	used = []
	while d * d <= n:
		if n % d == 0:
			if d not in used:
				Ans *= d
				used.append(d)
			n //= d
		else:
			d += 1
	if n > 1:
		if n not in used:
			Ans *= n
	return Ans
print(Factor(int(input())))


import sys
input = sys.stdin.readline

def ceil(x):
	if x != int(x):
		x = int(x) + 1
	return x

def factorial(x, m):
	val = 1
	while x > 0:
		val = val * x % m
		x -= 1
	return val

def fact(x):
	val = 1
	while x > 0:
		val *= x
		x -= 1
	return val

def swaparr(arr, a, b):
	temp = arr[a]
	arr[a] = arr[b]
	arr[b] = temp

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def nCr(n, k):
	if k > n - k:
		k = n - k
	res = 1
	for i in range(k):
		res = res * (n - i)
		res = res / (i + 1)
	return int(res)

def upper_bound(a, x, lo=0, hi=None):
	if hi == None:
		hi = len(a)
	while lo < hi:
		mid = (lo + hi) // 2
		if a[mid] < x:
			lo = mid + 1
		else:
			hi = mid
	return lo

def primefs(n):
	primes = {}
	while n % 2 == 0 and n > 0:
		primes[2] = primes.get(2, 0) + 1
		n = n // 2
	for i in range(3, int(n ** 0.5) + 2, 2):
		while n % i == 0 and n > 0:
			primes[i] = primes.get(i, 0) + 1
			n = n // i
	if n > 2:
		primes[n] = primes.get(n, 0) + 1
	return primes

def power(x, y, p):
	res = 1
	x = x % p
	if x == 0:
		return 0
	while y > 0:
		if y & 1 == 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def swap(a, b):
	temp = a
	a = b
	b = temp
	return (a, b)

def find(x, link):
	p = x
	while p != link[p]:
		p = link[p]
	while x != p:
		nex = link[x]
		link[x] = p
		x = nex
	return p

def union(x, y, link, size):
	x = find(x, link)
	y = find(y, link)
	if size[x] < size[y]:
		(x, y) = swap(x, y)
	if x != y:
		size[x] += size[y]
		link[y] = x

def sieve(n):
	prime = [True for i in range(n + 1)]
	(prime[0], prime[1]) = (False, False)
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	return prime
MAXN = int(100000.0 + 5)

def spf_sieve():
	spf[1] = 1
	for i in range(2, MAXN):
		spf[i] = i
	for i in range(4, MAXN, 2):
		spf[i] = 2
	for i in range(3, ceil(MAXN ** 0.5), 2):
		if spf[i] == i:
			for j in range(i * i, MAXN, i):
				if spf[j] == j:
					spf[j] = i
spf = [0 for i in range(MAXN)]

def factoriazation(x):
	res = []
	for i in range(2, int(x ** 0.5) + 1):
		while x % i == 0:
			res.append(i)
			x //= i
	if x != 1:
		res.append(x)
	return res

def int_array():
	return list(map(int, input().strip().split()))

def float_array():
	return list(map(float, input().strip().split()))

def str_array():
	return input().strip().split()
MOD = int(1000000000.0) + 7
CMOD = 998244353
INF = float('inf')
NINF = -float('inf')
from itertools import permutations
import math
from bisect import bisect_left

def solve():
	n = int(input())
	m = -1
	for i in range(1, int(n ** 0.5) + 1):
		if n % i != 0:
			continue
		a = factoriazation(i)
		b = factoriazation(n // i)
		if len(list(set(b))) == len(b):
			print(n // i)
			return
		elif len(list(set(a))) == len(a):
			m = i
	print(m)
for _ in range(1):
	solve()


from sys import *
inp = lambda : stdin.readline()
N = int(1000000.0) + 20

def main():
	siv = [0 for i in range(N)]
	for i in range(2, N):
		if siv[i] == 0:
			for j in range(i * i, N, i):
				siv[j] = 1
	primes = []
	for i in range(2, N):
		if siv[i] == 0:
			primes.append(i)
	n = int(inp())
	for i in primes:
		if i > n:
			break
		while n % (i * i) == 0:
			n //= i
	print(n)
main()


from sys import stdin, stdout
input = stdin.readline
n = int(input())
for i in range(2, 10 ** 6 + 1):
	while n % (i * i) == 0:
		n //= i
stdout.write(str(n))


import math as mt
import sys, string, bisect
input = sys.stdin.readline
import random
from collections import deque, defaultdict
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())

def isprime(n):
	if n % 2 == 0:
		return False
	else:
		for i in range(3, int(mt.sqrt(n)) + 1, 2):
			if n % i == 0:
				return False
		return True
n = I()
d = defaultdict(int)
i = 2
while n != 1 and n % 2 == 0:
	d[2] += 1
	n //= 2
i = 3
while n != 1 and i <= int(mt.sqrt(n)) + 1:
	if n % i == 0:
		d[i] += 1
		n //= i
	else:
		i += 2
if n != 1:
	d[n] += 1
ans = 1
for i in d.keys():
	ans *= i
print(ans)


import heapq
import sys
from math import *
import threading
from heapq import *
from itertools import count
from pprint import pprint
from collections import defaultdict
from heapq import heapify, heappop, heappush
mod = 10 ** 9 + 7
inf = 10 ** 15
decision = ['NO', 'YES']
yes = 'YES'
no = 'NO'
import os
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD

	def npr(self, n, k):
		if k < 0 or n < k:
			return 0
		f = self.factorial
		return f.calc(n) * f.invFactorial(n - k) % self.MOD

class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: max(a, b)):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

def lower_bound(li, num):
	answer = len(li)
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] >= num:
			answer = middle
			end = middle - 1
		else:
			start = middle + 1
	return answer

def upper_bound(li, num):
	answer = len(li)
	start = 0
	end = len(li) - 1
	while start <= end:
		middle = (end + start) // 2
		if li[middle] <= num:
			start = middle + 1
		else:
			answer = middle
			end = middle - 1
	return answer

def abs(x):
	return x if x >= 0 else -x

def binary_search(li, val):
	ans = -1
	lb = 0
	ub = len(li) - 1
	while lb <= ub:
		mid = (lb + ub) // 2
		if li[mid] > val:
			ub = mid - 1
		elif val > li[mid]:
			lb = mid + 1
		else:
			ans = mid
			break
	return ans

def kadane(x):
	sum_so_far = 0
	current_sum = 0
	for i in x:
		current_sum += i
		if current_sum < 0:
			current_sum = 0
		else:
			sum_so_far = max(sum_so_far, current_sum)
	return sum_so_far

def pref(li):
	pref_sum = [0]
	for i in li:
		pref_sum.append(pref_sum[-1] + i)
	return pref_sum

def SieveOfEratosthenes(n):
	prime = [{1, i} for i in range(n + 1)]
	p = 2
	while p <= n:
		for i in range(p * 2, n + 1, p):
			prime[i].add(p)
		p += 1
	return prime

def primefactors(n):
	factors = []
	while n % 2 == 0:
		factors.append(2)
		n //= 2
	for i in range(3, int(sqrt(n)) + 1, 2):
		while n % i == 0:
			factors.append(i)
			n //= i
	if n > 2:
		factors.append(n)
	return factors

def prod(li):
	ans = 1
	for i in li:
		ans *= i
	return ans
inf = 10 ** 9 + 7

def main():
	karmanya = 1
	while karmanya != 0:
		karmanya -= 1
		n = int(input())
		ans = 1
		for i in range(2, int(sqrt(n)) + 1):
			if n % i == 0:
				ans *= i
			while n % i == 0:
				n //= i
		print(ans * n)
main()


from functools import reduce
from operator import mul
(n, D) = (int(input()), set())
for d in range(2, 1000001):
	while n % d == 0:
		D.add(d)
		n //= d
	if n == 1:
		break
print(reduce(mul, D | {n}))


n = int(input())
upper_bound = int(pow(n, 1 / 2) + 1)
bs = upper_bound * [True]
bs[0] = False
bs[1] = False
primes = []
p = 2
while p < upper_bound:
	if bs[p]:
		for j in range(p * p, upper_bound, p):
			bs[j] = False
		primes.append(p)
	p += 1
pfs = set()
for pf in primes:
	if pf * pf > n:
		break
	while n % pf == 0:
		pfs.add(pf)
		n //= pf
if n != 1:
	pfs.add(n)
result = 1
for pf in pfs:
	result *= pf
print(result)


a = int(input())
for i in range(2, 1000000):
	while a % i ** 2 == 0:
		a //= i
print(a)


from itertools import accumulate, chain, cycle
n = int(input())

def prime_powers_iter(n):
	for c in accumulate(chain([2, 1, 2], cycle([2, 4]))):
		if c * c > n:
			break
		if n % c:
			continue
		(d, p) = ((), c)
		while not n % c:
			(n, p, d) = (n // c, p * c, d + (p,))
		yield d
	if n > 1:
		yield (n,)

def prime_powers(n):
	return list((i[0] for i in list(prime_powers_iter(n))))
mul = 1
for i in prime_powers(n):
	mul *= i
print(mul)


def factorize(n):
	result = {}
	i = 2
	while i * i <= n:
		(d, m) = divmod(n, i)
		if m == 0:
			count = 0
			while m == 0:
				count += 1
				n = d
				(d, m) = divmod(n, i)
			result[i] = count
		i += 1
	result[n] = 1
	return result
n = int(input())
result = 1
for (k, v) in list(factorize(n).items()):
	result *= k
print(result)


from collections import Counter
n = int(input())

def prime_factors(n):
	i = 2
	factors = []
	while i * i <= n:
		if n % i:
			i += 1
		else:
			n //= i
			factors.append(i)
	if n > 1:
		factors.append(n)
	return factors

def product(l):
	p = 1
	for i in l:
		p *= i
	return p
print(product(Counter(prime_factors(n)).keys()))


n = int(input())
isLovely = True
ans = 1
for div in range(2, int(n ** 0.5 * 2)):
	if n % div == 0:
		ans *= div
	while n % div == 0:
		n //= div
ans *= n
print(ans)


n = int(input())
(c, out) = (2, n)
while c * c <= n:
	if out % c ** 2 == 0:
		out //= c
	else:
		c += 1
print(out)


def primefactor(x):
	ans = 1
	n = x
	if x % 2 == 0:
		ans *= 2
	while x % 2 == 0:
		x /= 2
	prev = 2
	for i in range(3, int(n ** 0.5) + 1, 2):
		curr = i
		if prev != curr and x % curr == 0:
			ans *= curr
			prev = i
		while x % i == 0:
			x /= i
	if x > 2:
		ans *= x
	return int(ans)
print(primefactor(int(input())))


from math import sqrt, ceil
num = int(input())
sqr = ceil(sqrt(num)) + 1
divs = []
for i in range(1, sqr):
	if num % i == 0:
		divs.append(i)
		divs.append(num // i)
divs.sort(reverse=1)
m = len(divs)
for i in range(m):
	tmp = divs[i]
	s = True
	for p in range(2, sqr):
		if tmp % p == 0:
			tmp /= p
		if tmp % p == 0:
			s = False
			break
	if s:
		print(divs[i])
		exit()


import math
n = int(input())
res = 1
for i in range(2, round(math.sqrt(n)) + 1):
	if n % i == 0:
		res *= i
		while n % i == 0:
			n = n // i
if n != 0:
	res *= n
print(res)


n = int(input())
A = []
F = []
for i in range(1, int(n ** 0.5) + 1):
	if n % i == 0:
		x = n // i
		A.append(x)
		A.append(i)
		F.append(True)
		F.append(True)
for i in range(len(A)):
	if A[i] != 1:
		if int(A[i] ** 0.5) ** 2 == A[i]:
			for j in range(len(A)):
				if A[j] % A[i] == 0:
					F[j] = False
B = [A[i] for i in range(len(A)) if F[i]]
print(max(B))


from math import sqrt
f = {}

def factor(n):
	if n in f:
		return f[n]
	factors = set()
	for x in range(1, int(sqrt(n)) + 1):
		if n % x == 0:
			factors.add(x)
			factors.add(n // x)
	factors = sorted(factors, reverse=True)
	f[n] = factors
	return factors
n = int(input())
for i in factor(n):
	is_success = True
	for j in factor(i):
		if j > 1:
			s = sqrt(j)
			if s == int(s):
				is_success = False
				break
	if is_success:
		print(i)
		return


import sys
import copy
import math

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_string():
	return sys.stdin.readline().strip()
t = 1
for test in range(t):
	n = int(input())
	arr = []
	while n % 2 == 0:
		arr.append(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			arr.append(i)
			n = n // i
	if n > 2:
		arr.append(n)
	arr = list(set(arr))
	ans = 1
	for i in arr:
		ans *= i
	print(ans)


def check(num):
	a = 2
	tmp = a * a
	while tmp <= num:
		if num % tmp == 0:
			return 0
		a += 1
		tmp = a * a
	return 1
n = int(input())
res = 1
i = 1
while i * i <= n:
	if n % i == 0:
		if check(i):
			res = max(i, res)
		if check(n // i):
			res = max(n // i, res)
	i += 1
print(res)


import math
n = int(input().split()[0])
sqroot = math.ceil(math.sqrt(n))
for i in range(2, sqroot + 1):
	while n % i ** 2 == 0:
		n //= i
print(n)


from math import sqrt
from sys import stdin
a = set()
n = int(stdin.readline())
n2 = sqrt(n)
t = 2
while t <= n2 and n > 1:
	if n % t == 0:
		n //= t
		a.add(t)
		t = 1
		n2 = sqrt(n)
	t += 1
a.add(n)
q = 1
for x in a:
	q *= x
print(q)


from functools import reduce
from operator import mul

def generate_primes(n):
	sieve = [1] * n
	for i in range(3, int(n ** 0.5) + 1, 2):
		if sieve[i]:
			sieve[i * i::2 * i] = [0] * ((n - i * i - 1) // (2 * i) + 1)
	return [2] + [i for i in range(3, n, 2) if sieve[i]]
PRIMES = generate_primes(1000000)
(n, D) = (int(input()), set())
for d in PRIMES:
	while n % d == 0:
		D.add(d)
		n //= d
	if n == 1:
		break
print(reduce(mul, D | {n}))


import sys
inf = float('inf')
from math import ceil, floor, log, sqrt, factorial, pow, pi, gcd
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
(mod, MOD) = (1000000007, 998244353)
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def all_factors(n):
	(small, large) = ([], [])
	for i in range(1, int(n ** 0.5) + 1, 2 if n & 1 else 1):
		if not n % i:
			small.append(i)
			large.append(n // i)
	if small[-1] == large[-1]:
		large.pop()
	large.reverse()
	small.extend(large)
	return small

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
n = int(input())
Arr = all_factors(n)
flag = 0
for i in range(len(Arr) - 1, 0, -1):
	if sqrt(Arr[i]) == ceil(sqrt(Arr[i])):
		flag = 1
		break
if flag == 0:
	print(n)
	exit(0)
for i in range(len(Arr) - 2, 0, -1):
	test = Arr[i]
	new_Arr = all_factors(test)
	flag = 0
	for j in range(len(new_Arr) - 1, 0, -1):
		if sqrt(new_Arr[j]) == ceil(sqrt(new_Arr[j])):
			flag = 1
			break
	if flag == 0:
		print(test)
		exit()


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
sys.setrecursionlimit(int(pow(10, 6)))
mod = int(pow(10, 9) + 7)
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]

def seive():
	prime = [1 for i in range(10 ** 6 + 2)]
	prime[0] = 0
	prime[1] = 0
	for i in range(10 ** 6 + 2):
		if prime[i]:
			for j in range(2 * i, 10 ** 6 + 2, i):
				prime[j] = 0
	return prime
for _ in range(1):
	n = l()[0]
	prime = seive()
	for i in range(2, int(n ** 0.5) + 2):
		if prime[i] and n % i == 0:
			while n % i == 0:
				n //= i
			n *= i
	print(n)


from collections import *
import sys
import math
from functools import reduce

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def li():
	return [int(i) for i in input().rstrip('\n').split(' ')]

def st():
	return input().rstrip('\n')

def val():
	return int(input())

def stli():
	return [int(i) for i in input().rstrip('\n')]

def persquare(x):
	return 1 if x ** 0.5 == int(x ** 0.5) else 0
n = val()
l = sorted(list(factors(n)))
j = len(l) - 1
while j >= 0:
	curr = 1
	currlist = sorted(list(factors(l[j])))
	for i in range(1, len(currlist)):
		if persquare(currlist[i]) and (not l[j] % currlist[i]):
			curr = 0
			break
	if curr:
		print(l[j])
		exit()
	j -= 1


n = int(input())
i = 2
tmp = 1
while i * i <= n:
	if n % i == 0:
		tmp = tmp * i
		while n % i == 0:
			n = n // i
	i = i + 1
print(n * tmp)


N = int(input())
i = 2
sol = 1
while i * i <= N:
	if N % i == 0:
		sol *= i
		while N % i == 0:
			N //= i
	i += 1
print(sol * N)


n = int(input())
ans = 1
prime = 2
while prime * prime <= n:
	if n % prime == 0:
		ans *= prime
		while n % prime == 0:
			n //= prime
	prime += 1
if n > 1:
	ans *= n
print(ans)


n = int(input())
d = 2
while d * d <= n:
	if n % d == 0:
		while n % (d * d) == 0:
			n //= d
	d += 1
print(n)


import math

def na():
	n = int(input())
	b = [int(x) for x in input().split()]
	return (n, b)

def nab():
	n = int(input())
	b = [int(x) for x in input().split()]
	c = [int(x) for x in input().split()]
	return (n, b, c)

def dv():
	(n, m) = map(int, input().split())
	return (n, m)

def dva():
	(n, m) = map(int, input().split())
	b = [int(x) for x in input().split()]
	return (n, m, b)

def nm():
	n = int(input())
	b = [int(x) for x in input().split()]
	m = int(input())
	c = [int(x) for x in input().split()]
	return (n, b, m, c)

def dvs():
	n = int(input())
	m = int(input())
	return (n, m)
n = int(input())
for i in range(10 ** 6, 1, -1):
	while n % (i * i) == 0:
		n //= i
print(n)


from collections import Counter, defaultdict, deque
from math import factorial as fact

def primes(n):
	i = 2
	factors = []
	while i * i <= n:
		if n % i:
			i += 1
		else:
			n //= i
			factors.append(i)
	if n > 1:
		factors.append(n)
	return factors
n = int(input())
s = set(primes(n))
a = 1
for i in s:
	a *= i
print(a)


import math
t = 1

def getPrimeFact(n):
	ans = []
	if n % 2 == 0:
		ans.append(2)
	while n % 2 == 0:
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		if n % i == 0:
			ans.append(i)
		while n % i == 0:
			n = n // i
	if n > 2:
		ans.append(n)
	return ans
for _ in range(t):
	n = int(input())
	primeFact = getPrimeFact(n)
	ans = 1
	for i in primeFact:
		ans *= i
	print(ans)


import math

def check(n):
	ans1 = []
	while n % 2 == 0:
		ans1.append(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			ans1.append(i)
			n = n // i
	if n > 2:
		ans1.append(n)
	return ans1

def fact(num):
	ans = []
	for i1 in range(1, int(math.sqrt(num) + 1)):
		if num % i1 == 0:
			t = num // i1
			if t != i1:
				ans.append(t)
				ans.append(i1)
			else:
				ans.append(i1)
	return ans
n = int(input())
fact = fact(n)
fact.sort(reverse=True)
for i in fact:
	t1 = check(i)
	if len(t1) == len(list(set(t1))):
		print(i)
		break


import sys
n = int(input())
di = [1]
i = 2
while n > 1:
	if i * i > n:
		break
	if n % i == 0:
		di += [i]
		while n % i == 0 and n > 1:
			n //= i
	i += 1
if n != 1:
	di += [n]
ans = 1
for item in di:
	ans *= item
print(ans)


from math import sqrt

def get_divisors(n):
	divisors = {n}
	for i in range(2, int(sqrt(n)) + 1):
		if n % i == 0:
			divisors.add(i)
			divisors.add(n // i)
	return divisors
n = int(input())
divisors = list(get_divisors(n))
divisors.sort()
i = len(divisors) - 1
j = 0
while j < i:
	if divisors[i] % (divisors[j] * divisors[j]) == 0 and divisors[i] % divisors[j] == 0:
		i -= 1
		j = 0
	else:
		j += 1
print(divisors[i])


def get_factors(n):
	i = 2
	factors = set()
	while i * i <= n:
		while n % i == 0:
			n //= i
			factors.add(i)
		i += 1
	factors.add(n)
	return factors

def main():
	n = int(input())
	factors = get_factors(n)
	ans = 1
	for k in factors:
		ans *= k
	print(ans)
main()


def Lovely(x):
	a = list(factors(x))
	a.sort(reverse=True)
	for i in a:
		if i ** 0.5 == int(i ** 0.5) and i > 1:
			return False
	return True

def factors(n):
	return set((x for tup in ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0) for x in tup))
r = int(input())
Factors = list(factors(r))
Factors.sort(reverse=True)
l = []
for i in Factors:
	if Lovely(i):
		print(i)
		break


from math import sqrt

def genprimes(limit):
	lim = limit // 6
	sieve = [False, True, True] * lim
	lim = lim * 3 - 1
	for (i, s) in enumerate(sieve):
		if s:
			(p, pp) = (i * 2 + 3, (i + 3) * i * 2 + 3)
			le = (lim - pp) // p + 1
			if le > 0:
				sieve[pp::p] = [False] * le
			else:
				break
	sieve[0] = sieve[3] = True
	res = [i * 2 + 3 for (i, f) in enumerate(sieve) if f]
	for (i, p) in enumerate((2, 3, 5, 7)):
		res[i] = p
	while res[-1] >= limit:
		del res[-1]
	return res

def main():
	(n, res) = (int(input()), 1)
	for p in genprimes(int(sqrt(n)) + 12):
		if not n % p:
			res *= p
			while not n % p:
				n //= p
			if n == 1:
				break
	print(res * n)
main()


n = int(input())
cnt = 2
memo = {}
prod = 1
while cnt * cnt <= n:
	if n % cnt == 0:
		prod *= cnt
		while n % cnt == 0:
			n /= cnt
	cnt += 1
if n > 1:
	prod *= n
print(int(prod))


n = int(input())
i = 2
while i * i <= n:
	while n % (i * i) == 0:
		n = n // i
	i = i + 1
print(n)


from math import sqrt

def divs(e):
	for elemento in range(1, int(sqrt(e) + 1)):
		if e % elemento == 0:
			if elemento == 1:
				if int(sqrt(e // elemento)) ** 2 == e // elemento:
					return 0
					break
			elif int(sqrt(elemento)) ** 2 == elemento or int(sqrt(e // elemento)) ** 2 == e // elemento:
				return 0
				break
	return e
n = int(input())
if n == 1:
	print(1)
else:
	divisores = []
	for e in range(1, int(sqrt(n) + 1)):
		if n % e == 0:
			divisores.append(e)
			if n // e != e:
				divisores.append(n // e)
	divisores.sort(reverse=True)
	for e in divisores:
		ans = divs(e)
		if ans != 0:
			print(ans)
			break


a = [1] * 1000001
a[0] = 0
a[1] = 0
for i in range(2, 1000):
	if a[i] == 1:
		for j in range(i * i, 1000001, i):
			a[j] = 0
Premier = []
for i in range(1000000):
	if a[i] == 1:
		Premier.append(i)
n = int(input())

def Divisors(n):
	L = []
	i = 1
	while i < n ** (1 / 2) + 1:
		if n % i == 0:
			if n % i == i:
				L.append(i)
			else:
				L.append(i)
				L.append(n // i)
		i = i + 1
	return L
L = Divisors(n)
L = sorted(L, reverse=True)

def lovely(n):
	i = 0
	while i < len(Premier) and n % Premier[i] ** 2 != 0:
		i = i + 1
	if i == len(Premier):
		return 1
	return 0
i = 0
while lovely(L[i]) != 1:
	i = i + 1
print(L[i])


n = int(input())
for i in range(2, 10 ** 6):
	s = i * i
	if s > n:
		break
	while n % s == 0:
		n = n // i
print(n)


import sys
input = sys.stdin.readline
import math

def divisors(n):
	i = 1
	l = []
	while i <= int(n ** 0.5):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(n // i)
				l.append(i)
		i = i + 1
	return l

def primefactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(i)
			n = n // i
	if n > 2:
		l.append(n)
	return l
n = int(input())
l = divisors(n)
l.sort(reverse=True)
for num in l:
	p = primefactors(num)
	s = set()
	flag = 0
	for i in p:
		if i in s:
			flag = 1
			break
		s.add(i)
	if flag:
		continue
	break
print(num)


from math import sqrt
x = int(input())
lol = []
i = 2
ans = 1
while i * i <= x:
	if x % i == 0:
		ans *= i
	while x % i == 0:
		x //= i
	i += 1
if x > 1:
	ans *= x
print(ans)


from math import *
n = int(input())
temp = floor(sqrt(n))
for i in range(2, temp + 1):
	if n % i == 0:
		while n % i == 0:
			n = n // i
		n *= i
print(n)


n = int(input())
for i in range(2, min(1000001, n)):
	while n % (i * i) == 0:
		n //= i
print(n)


import math
n = int(input())
m = n
m = math.sqrt(m)
m = math.floor(m)
i = 2
x = 1
while i <= m:
	if n % i * i == 0:
		while n % i == 0:
			n = n // i
		n = n * i
		m = n
		m = math.sqrt(m)
		m = math.floor(m)
	i = i + 1
print(n)


import math, operator
from functools import reduce
n = int(input())

def getFactor(n):
	for i in range(2, int(math.sqrt(n)) + 1):
		if n % i == 0:
			return i
	return n
s = set()
s.add(1)
while n > 1:
	m = getFactor(n)
	s.add(m)
	n = n // m
print(reduce(operator.mul, s, 1))


import math
n = int(input())
facs = []
for i in range(1, int(n ** 0.5) + 1):
	if n % i == 0:
		facs.append(n // i)
		facs.append(i)
facs = sorted(facs)
for j in range(len(facs) - 1, -1, -1):
	flag = 0
	i = 2
	while i * i <= facs[j]:
		if facs[j] % (i * i) == 0:
			flag = 1
			break
		i += 1
	if flag == 0:
		break
print(facs[j])


import math
num = int(input())
res = 1
first = 0
while num % 2 == 0:
	if first == 0:
		res *= 2
		first = 1
	num = num // 2
for i in range(3, int(math.sqrt(num)) + 1, 2):
	first = 0
	while num % i == 0:
		if first == 0:
			res *= i
			first = 1
		num = num // i
if num > 2:
	res *= num
print(res)


from math import sqrt
BOUND = 1000000

def sieve(n):
	primes = [True] * (n + 1)
	(primes[0], primes[1]) = (False, False)
	ans = []
	for i in range(2, int(sqrt(n)) + 1):
		if primes[i]:
			for j in range(i * i, n + 1, i):
				primes[j] = False
	for i in range(n + 1):
		if primes[i]:
			ans.append(i)
	return ans

def prime_factors(n, primes):
	factors = []
	for pf in primes:
		while n % pf == 0:
			factors.append(pf)
			n //= pf
	factors.append(n)
	return factors

def get_divisors(n):
	divs = set()
	for d in range(1, int(sqrt(n)) + 1):
		if n % d == 0:
			divs.add(d)
			divs.add(n // d)
	return list(divs)

def main():
	primes = sieve(BOUND)
	n = int(input())
	factors = set(prime_factors(n, primes))
	ans = 1
	for d in factors:
		ans *= d
	print(ans)
main()


def main():
	n = int(input())
	i = 2
	while n >= i ** 2:
		while n % i ** 2 == 0:
			n //= i
		i += 1
	print(n)
main()


import math
from collections import defaultdict

def input_ints():
	return list(map(int, input().split()))

def solve():
	n = int(input())
	ans = 1
	for x in range(2, int(n ** 0.5 + 1)):
		if n % x == 0:
			ans *= x
			while n % x == 0:
				n //= x
	if n > 1:
		ans *= n
	print(ans)
solve()


n = int(input())

def bigLove(m):
	s = 1
	if m % 2 == 0:
		s = 2
		while m % 2 == 0:
			m = m // 2
	i = 3
	while i * i <= m:
		if m % i == 0:
			while m % i == 0:
				m = m // i
			s *= i
		i += 2
	if m > 2:
		s *= m
	return s
print(bigLove(n))


import math
n = int(input())
xs = int(math.sqrt(n))
ls = []
for i in range(1, xs + 1):
	if n % i == 0:
		ls.append(i)
		if i * i != n:
			xs = n // i
			ls.append(xs)
n = math.sqrt(n)
m = len(ls)
if m != 0:
	ls.sort()
xs = 0
i = m - 1
while i >= 0:
	ys = int(math.sqrt(ls[i]))
	if len(ls) == 1:
		xs = 1
		break
	j = 1
	done = 0
	while ls[j] <= ys:
		a = ls[j] * ls[j]
		if ls[i] % a == 0:
			done = 1
		j += 1
	if done == 0:
		xs = ls[i]
		break
	i -= 1
print(xs)


from math import sqrt

def refine(n):
	for i in range(2, int(sqrt(n)) + 1):
		if n % i ** 2 == 0:
			n = n / i
			return n
			break
	return n
n = int(input())
previousN = 0
while n != previousN:
	previousN = n
	n = refine(previousN)
print(int(n))


import math

def factorization(n):
	l = set()
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n / i == i:
				l.add(i)
			else:
				l.add(i)
				l.add(int(n / i))
		i += 1
	return l
n = int(input())
if n > 3:
	l = factorization(n)
	l = list(l)
	l.pop(0)
	flag = False
	l.sort()
	i = 2
	j = len(l) - 1
	while i < int(math.sqrt(l[j])) + 1:
		if l[j] % pow(i, 2) == 0:
			j -= 1
			i = 1
		i += 1
	print(l[j])
else:
	print(n)


import math
n = int(input())
div = set()
div.add(1)
div.add(n)
for i in range(2, int(math.sqrt(n)) + 1):
	if n % i == 0:
		div.add(i)
		if n / i != i:
			div.add(n / i)
for i in range(2, int(math.sqrt(n)) + 1):
	if i ** 2 in div:
		while n % i ** 2 == 0:
			n = n // i ** 2
			n = n * i
print(n)


n = int(input())
N = 1000100
a = [1 for i in range(N)]
primes = []
for i in range(2, N):
	if a[i] == 1:
		primes.append(i)
		for j in range(i * i, N, i):
			a[j] = 0
ans = 1
for x in primes:
	if n % x == 0:
		ans = ans * x
		while n % x == 0:
			n = n // x
if n != 1:
	ans = ans * n
print(ans)


n = int(input())
k = 10 ** 6 + 1
for i in range(2, min(n, k)):
	while not n % i ** 2:
		n //= i
print(n)


n = int(input())
sq = n ** 0.5
l = []
i = 1
while i <= sq:
	if n % i == 0:
		if n / i == i:
			l.append(i)
		else:
			l.append(i)
			l.append(n // i)
	i = i + 1
l.sort()
l = l[::-1]
for i in range(len(l)):
	e = l[i]
	j = 2
	q = j * j
	t = 0
	while q <= e:
		if q in l and e % q == 0:
			t = 1
			break
		else:
			j = j + 1
			q = j * j
	if t == 0:
		print(e)
		break


import math
divisors = []
answer = 1
i = 0
number = int(input())
sqrt = int(math.floor(math.sqrt(number)))
for j in range(1, sqrt + 1):
	if number % j == 0:
		divisors.append(j)
		divisors.append(number // j)
divisors.sort(reverse=True)
while True:
	sqrt = math.sqrt(divisors[i])
	if sqrt % 1 == 0:
		i += 1
	bln = True
	last = divisors[i]
	sqrt = int(math.sqrt(last))
	for j in range(2, sqrt + 1):
		if last % j == 0:
			if math.sqrt(last // j) % 1 == 0 or math.sqrt(j) % 1 == 0:
				bln = False
				break
	if bln:
		answer = last
		break
	else:
		i += 1
print(int(answer))


n = int(input())
s = set()
i = 2
while i <= int(n ** 0.5) + 1:
	if n % i == 0:
		s.add(i)
		while n % i == 0:
			n = n // i
	i += 1
if n > 1:
	s.add(n)
prod = 1
for i in s:
	prod *= i
print(prod)


def factorise(n):
	dic = {}
	while n % 2 == 0:
		if 2 in dic:
			dic[2] += 1
		else:
			dic[2] = 1
		n = n / 2
	for i in range(3, int(n ** 0.5) + 1):
		while n % i == 0:
			if i in dic:
				dic[i] += 1
			else:
				dic[i] = 1
			n = n / i
	if n > 2:
		dic[n] = 1
	return dic
n = int(input())
dic = factorise(n)
arr = sorted(list(dic.keys()))
final = 1
for i in arr:
	final *= i
print(int(final))


n = int(input())
prime = [True] * 1000001
for i in range(2, 1000000):
	if prime[i]:
		for j in range(i * i, 1000000, i):
			prime[j] = False
		if n % i == 0:
			while n % i == 0:
				n //= i
			n *= i
print(n)


import math
n = int(input())
if n == 1:
	print(1)
	quit()
s_p = set()
while n % 2 == 0:
	s_p.add(2)
	n = n // 2
i = 3
while i <= math.sqrt(n):
	while n % i == 0:
		s_p.add(i)
		n //= i
	i += 2
if n > 2:
	s_p.add(n)
t = 1
for n in s_p:
	t *= n
print(t)


import math
n = int(input())
maxval = n
i = 2
while i * i <= n:
	while maxval % (i * i) == 0:
		maxval //= i
	i += 1
print(maxval)


from collections import deque

def divisors(n):
	d = deque()
	i = 1
	while i * i <= n:
		if n % i == 0:
			if n // i == i:
				d.append(i)
			else:
				d.append(i)
				d.append(n // i)
		i += 1
	return d
n = int(input())
r = divisors(n)
r = sorted(r)
r2 = list(reversed(sorted(r)))
ans = -1
for i in r2:
	f = True
	for j in r:
		if j > 1:
			if i % (j * j) == 0:
				f = False
				break
	if f:
		ans = i
		break
print(ans)


from io import BytesIO, IOBase
from math import sqrt
import sys, os
from os import path
inpl = lambda : list(map(int, input().split()))
inpm = lambda : map(int, input().split())
inpi = lambda : int(input())
inp = lambda : input()
(rev, ra, l) = (reversed, range, len)
P = print
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')

def B(n):
	return bin(n).replace('0b', '')

def factors(n):
	arr = []
	for i in ra(2, int(sqrt(n)) + 1):
		if n % i == 0:
			arr.append(i)
			if i * i != n:
				arr.append(int(n / i))
	return arr

def prime_factors(n):
	omap = {2: 0}
	while n != 1 and n % 2 == 0:
		omap[2] += 1
		n /= 2
	for i in ra(3, int(math.sqrt(n)) + 1, 2):
		while n != 1 and n % i == 0:
			if i not in omap:
				omap[i] = 1
			else:
				omap[i] += 1
			n /= i
	if n != 1:
		omap[int(n)] = 1
	return omap

def dfs(arr, n):
	pairs = [[i + 1] for i in ra(n)]
	vis = [0] * (n + 1)
	for i in ra(l(arr)):
		pairs[arr[i][0] - 1].append(arr[i][1])
	pairs[arr[i][1] - 1].append(arr[i][0])
	comp = []
	for i in ra(n):
		stack = [pairs[i]]
		temp = []
		if vis[stack[-1][0]] == 0:
			while len(stack) > 0:
				if vis[stack[-1][0]] == 0:
					temp.append(stack[-1][0])
					vis[stack[-1][0]] = 1
					s = stack.pop()
					for j in s[1:]:
						if vis[j] == 0:
							stack.append(pairs[j - 1])
				else:
					stack.pop()
			comp.append(temp)
	return comp
from bisect import bisect_left as bl
from bisect import bisect_right as br
import sys, operator, math, operator
from collections import Counter
if path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
import random, heapq
n = inpi()
omap = prime_factors(n)
ans = 1
for (k, v) in omap.items():
	if v > 0:
		ans *= k
P(ans)


import math
n = int(input())
i = 2
while i <= math.sqrt(n):
	if n % (i * i) == 0:
		n = n / i
		i = 1
	i += 1
print(int(n))


def fac(n):
	res = set()
	d = 2
	while d * d <= n:
		if n % d == 0:
			n = n // d
			res.add(d)
		else:
			d += 1
	if n > 1:
		res.add(n)
	return res
n = int(input())
nums = fac(n)
res = 1
for num in nums:
	res *= num
print(res)


n = int(input())
a = []
j = 2
while n != 1 and j <= n ** 0.5:
	if n % j == 0:
		n //= j
		a.append(j)
		while n % j == 0:
			n //= j
	j += 1
a.append(n)
n = 1
for i in range(len(a)):
	n *= a[i]
print(n)


__author__ = 'yarsanich'
import math
n = int(input())
ans = 1
if n % 2 == 0:
	ans *= 2
	while n % 2 == 0:
		n /= 2
i = 3
while i <= int(math.sqrt(n)) + 1:
	if n % i == 0:
		ans *= i
		while n % i == 0:
			n /= i
	i += 2
if n > 2:
	ans *= n
print(int(ans))


n = int(input())
member = []
i = 2
ans = 1
while 1:
	if i * i <= n:
		if n % i == 0:
			while n % i == 0:
				n //= i
			ans *= i
			member.append(i)
		i += 1
	else:
		break
print(ans * n if len(member) > 0 else n)


import sys
n = int(sys.stdin.readline())
ln = 1
if n % 2 == 0:
	ln = 2
	while n % 2 == 0:
		n /= 2
for i in range(3, int(n ** 0.5) + 1, 2):
	if n % i == 0:
		ln *= i
		while n % i == 0:
			n /= i
if n > 2:
	ln *= n
print(int(ln))


n = int(input())
i = 2
tot = 1
while i * i <= n:
	if n % i == 0:
		tot = tot * i
		while n % i == 0:
			n = n // i
	i += 1
if n > 1:
	tot = tot * n
print(tot)


ans = 1
flag = False
n = int(input())
while n % 2 == 0:
	if flag == False:
		flag = True
		ans *= 2
	n = n // 2
flag = False
i = 3
while i * i <= n:
	while n % i == 0:
		if flag == False:
			flag = True
			ans *= i
		n = n // i
	flag = False
	i += 2
if n > 2:
	ans *= n
print(ans)


def compute():
	n = int(input())
	(it, ans) = (2, 1)
	while it * it <= n:
		if n % it == 0:
			ans *= it
			while n % it == 0:
				n //= it
		it += 1
	if n != 1:
		ans *= n
	return ans
print(compute())


n = int(input())
c = n
a = n ** 0.5 + 1
d = 2
A = 1
while d <= a:
	if n % d == 0:
		n //= d
		if A % d != 0:
			A *= d
	else:
		d += 1
if n > 1:
	A *= n
print(A)


import math
n = int(input())
divisores = []
for i in range(1, int(math.sqrt(n) + 1)):
	if n % i == 0:
		divisores.append(i)
		if n / i != i:
			divisores.append(n / i)
divisores.sort()
for i in range(len(divisores) - 1, -1, -1):
	k = divisores[i]
	teste = True
	cont = 2
	while cont * cont <= k:
		if k % (cont * cont) == 0:
			teste = False
			break
		cont += 1
	if teste:
		print(int(k))
		break


import math
n = int(input())

def factors(n):
	return set((x for tup in ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0) for x in tup))
for factor in sorted(factors(n), reverse=True):
	failed = False
	for f in factors(factor):
		if f != 1 and f == int(math.sqrt(f)) ** 2:
			failed = True
			break
	if not failed:
		print(factor)
		break


from sys import stdin, stdout
from collections import *
from math import gcd, floor, ceil
st = lambda : list(stdin.readline().strip())
li = lambda : list(map(int, stdin.readline().split()))
mp = lambda : map(int, stdin.readline().split())
inp = lambda : int(stdin.readline())
pr = lambda n: stdout.write(str(n) + '\n')
mod = 1000000007
INF = float('inf')

def solve():
	n = inp()
	factor = []
	i = 1
	while i * i <= n:
		if n % i == 0:
			factor.append(i)
			if i != n // i:
				factor.append(n // i)
		i += 1
	factor.sort(reverse=True)
	for i in factor:
		j = 2
		f = 0
		while j * j <= i:
			if i % (j * j) == 0:
				f = 1
				break
			j += 1
		if f == 0:
			pr(i)
			return
for _ in range(1):
	solve()


def isLovely(n):
	return all((n % a ** 2 for a in range(2, int(n ** 0.5) + 1)))

def factors(n):
	from functools import reduce
	return sorted(list(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))
n = int(input().strip())
facs = factors(n)
i = len(facs) - 1
while not isLovely(facs[i]):
	i -= 1
print(facs[i])


n = int(input())
mim = 1
i = 2
while i * i <= n:
	if n % i == 0:
		mim *= i
	while n % i == 0:
		n //= i
	i += 1
mim *= n
print(mim)


import sys
import os.path
from math import floor, gcd, fabs, factorial, fmod, sqrt, inf, log
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
n = int(input())
t = False
while not t:
	t = True
	for i in range(2, int(sqrt(n)) + 1):
		if n % (i * i) == 0:
			n = n // i
			t = False
			break
print(n)


import math

def prime_factors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(int(i))
			n = n / i
	if n > 2:
		l.append(int(n))
	return l
n = int(input())
z = prime_factors(n)
if len(z) <= 2:
	if len(z) == 2 and z[0] == z[1]:
		print(z[0])
	else:
		print(n)
else:
	z = list(set(z))
	s = 1
	for i in z:
		s = s * i
	print(s)


import math
import sys

def factors(n):
	s = []
	l = []
	for i in range(1, int(math.sqrt(n)) + 1, 2 if n & 1 else 1):
		if n % i == 0:
			s.append(i)
			l.append(n // i)
	if s[-1] == l[-1]:
		l.pop()
	l.reverse()
	s.extend(l)
	s.sort(reverse=True)
	return s
n = int(input())
l = factors(n)
f = 0
for i in range(len(l) - 1):
	if math.sqrt(l[i]) == int(math.sqrt(l[i])):
		f = 1
		break
if f == 0:
	print(n)
	exit(0)
for i in range(1, len(l) - 1):
	li = factors(l[i])
	f = 0
	for j in range(len(li) - 1):
		if math.sqrt(li[j]) == int(math.sqrt(li[j])):
			f = 1
			break
	if f == 0:
		print(l[i])
		exit()


import math
from sys import stdin, stdout

def check(k):
	i = 2
	i2 = i * i
	while i2 <= k:
		if k % i2 == 0:
			return False
		i += 1
		i2 = i * i
	return True
line = stdin.readline()
n = int(line)
ans = 0
sq_n = int(math.sqrt(n))
i = 1
while i <= sq_n:
	if n % i != 0:
		i += 1
		continue
	if check(i) == True:
		ans = max(ans, i)
	j = int(n / i)
	if check(j) == True:
		ans = max(ans, j)
	i += 1
print(ans)


valor = int(input())
i = 2
while i < int(valor ** 0.5) + 1:
	if valor % i ** 2 == 0:
		valor //= i
		i = 1
	i += 1
print(valor)


from math import *
n = int(input())
for i in range(2, 10 ** 6):
	while n % (i * i) == 0:
		n //= i
print(n)


import math
n = int(input())
y = 0
if n == 1:
	print(1)
	exit(0)
while n ** 0.5 % 1 == 0:
	n = int(n ** 0.5)
for i in range(2, int(n ** 0.5) + 1):
	x = math.log(n, i)
	if n % i == 0:
		j = int(x) + 1
		while j >= 2:
			if n % i ** j == 0:
				y += 1
			j -= 1
		n /= i ** y
		y = 0
print(int(n))


from collections import Counter

def get_factors(n):
	i = 2
	ans = Counter()
	while i * i <= n:
		while n % i == 0:
			n //= i
			ans[i] += 1
		i += 1
	if n != 1:
		ans[n] += 1
	return ans

def main():
	n = int(input())
	factors = get_factors(n)
	ans = 1
	for (k, v) in factors.items():
		ans *= k
	print(ans)
main()


n = int(input())
ka = 1
for i in range(2, int(n ** 0.5 * 2)):
	if n % i == 0:
		ka = ka * i
	while n % i == 0:
		n = n // i
print(ka * n)


n = int(input())

def make_divisors(n):
	(lower_divisors, upper_divisors) = ([], [])
	i = 1
	while i * i <= n:
		if n % i == 0:
			lower_divisors.append(i)
			if i != n // i:
				upper_divisors.append(n // i)
		i += 1
	return lower_divisors + upper_divisors[::-1]
Q = make_divisors(n)
import math
Q.reverse()
for i in range(len(Q)):
	for j in range(2, 10000000000):
		if Q[i] % j ** 2 == 0:
			break
		if j ** 2 > Q[i]:
			print(Q[i])
			exit()


n = int(input())
x = 1
d = 2
while n > 1 and d * d <= n:
	if n % d == 0:
		x *= d
		while n % d == 0:
			n //= d
	d += 1
print(x * n)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
import random
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def divisions(n):
	sq = int(math.sqrt(n) + 1)
	d = collections.defaultdict(int)
	while n % 2 == 0:
		n //= 2
		d[2] += 1
	i = 3
	while n > 1 and sq >= i:
		if n % i == 0:
			n //= i
			d[i] += 1
		else:
			i += 2
	if n > 1:
		d[n] += 1
	return d

def main():
	n = I()
	d = divisions(n)
	r = 1
	for k in d.keys():
		r *= k
	return r
print(main())


n = int(input())
divisors = []
for i in range(2, int(n ** (1 / 2)) + 1):
	if n % i == 0:
		divisors.append(n // i)
		divisors.append(i)
divisors.append(n)
divisors.sort()
perfect_squares = []
i = 2
while i * i <= n:
	perfect_squares.append(i * i)
	i += 1
for divisor in divisors[::-1]:
	is_valid = True
	for square in perfect_squares:
		if divisor % square == 0:
			is_valid = False
			break
	if is_valid:
		print(divisor)
		break


n = int(input())
ans = 1
f = 2
while f * f <= n:
	if n % f == 0:
		ans *= f
		while n % f == 0:
			n //= f
	f += 1
if n > 1:
	ans *= n
print(ans)


n = int(input())
nummers = []
delers = []
goednummer = 0
doorgaan = True
lol = 1
while lol * lol <= n:
	if n % lol == 0:
		nummers.append(lol)
		if lol * lol != n:
			nummers.append(n // lol)
	lol += 1
nummers = sorted(nummers)
for j in nummers:
	delers.append(j ** 2)
getal1 = n
getal2 = 2
while doorgaan == True and n > 1:
	for k in range(1, len(delers)):
		if getal1 % delers[k] == 0:
			getal1 = nummers[len(delers) - getal2]
			getal2 += 1
			break
		elif k == len(delers) - 1:
			doorgaan = False
if n > 1:
	print(getal1)
else:
	print(1)


n = int(input())
sol = 1
i = 2
while i * i <= n:
	if n % i == 0:
		sol *= i
	while n % i == 0:
		n //= i
	i += 1
if n != 1 and sol % n != 0:
	sol *= n
print(sol)


c = int(input())
for i in range(2, int(c ** (1 / 2)) + 1):
	while c % (i * i) == 0:
		c = c / i
print(int(c))


import math
n = int(input())
primes = []
while n % 2 == 0:
	primes.append(2)
	n //= 2
x = 3
while n != 1:
	while n % x == 0:
		primes.append(x)
		n //= x
	x += 2
	if x >= math.floor(math.sqrt(n)) + 1:
		primes.append(n)
		break
factors = [1]
for x in primes:
	for y in factors[:]:
		if not x * y in factors:
			factors.append(x * y)
factors = sorted(factors)[::-1]
for x in factors:
	condition = True
	for y in range(2, math.floor(math.sqrt(x)) + 1):
		if x % y ** 2 == 0:
			condition = False
			break
	if condition:
		print(x)
		break


import math

def lovely(x):
	m = int(math.sqrt(x))
	for i in range(2, m + 1):
		if x % (i * i) == 0:
			return False
	return True

def reduce(f, i):
	ans = []
	for x in i:
		ans = f(ans, x)
	return ans

def factors(n):
	return sorted(list(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))), reverse=True)
n = int(input())
fact = factors(n)
for i in fact:
	if lovely(i):
		print(i)
		break


from functools import reduce
import os
import sys
from collections import *
from decimal import *
from math import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def arr():
	return [int(i) for i in input().split()]

def sarr():
	return [int(i) for i in input()]

def starr():
	return [str(x) for x in input().split()]

def inn():
	return int(input())

def svalue():
	return tuple(map(str, input().split()))

def parr():
	return [value() for i in range(n)]

def Ceil(a, b):
	return a // b + int(a % b > 0)
albhabet = 'abcdefghijklmnopqrstuvwxyz'
mo = 1000000007
inf = 1e+18
div = 998244353

def factors(n):
	return list(set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0))))
l = []
val = 4
diff = 5
for _ in range(1000000):
	l.append(val)
	val += diff
	diff += 2
n = inn()
val = factors(n)
mx = -inf
for i in val:
	flag = 0
	if i != 1:
		for j in l:
			if i % j == 0:
				flag = 1
				break
			elif j > i:
				break
	if flag == 0:
		mx = max(mx, i)
print(mx)


from math import sqrt
n = int(input())
primes = set()
while n % 2 == 0:
	primes.add(2)
	n //= 2
i = 3
while n != 1 and i < int(sqrt(n)) + 1:
	if n % i == 0:
		primes.add(i)
		n //= i
	else:
		i += 2
primes.add(n)
res = 1
for el in primes:
	res *= el
print(res)


from math import sqrt

def isPerfectSq(n):
	if n == 1:
		return False
	if sqrt(n).is_integer():
		return True
	return False

def divi(n, flag=True):
	l = []
	sq = int(sqrt(n)) + 1
	for i in range(1, sq):
		if n % i == 0:
			if flag and isPerfectSq(i):
				return []
			l.append(i)
			if i != n // i:
				if flag and isPerfectSq(n // i):
					return []
				l.append(n // i)
	return l
n = int(input())
l = divi(n, False)
l.sort(reverse=True)
for i in l:
	if divi(i) != []:
		print(i)
		break


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
from math import factorial
from collections import Counter, defaultdict, deque
from heapq import heapify, heappop, heappush

def RL():
	return map(int, sys.stdin.readline().rstrip().split())

def RLL():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def N():
	return int(input())

def comb(n, m):
	return factorial(n) / (factorial(m) * factorial(n - m)) if n >= m else 0

def perm(n, m):
	return factorial(n) // factorial(n - m) if n >= m else 0

def mdis(x1, y1, x2, y2):
	return abs(x1 - x2) + abs(y1 - y2)
mod = 998244353
INF = float('inf')
from math import sqrt, ceil

def main():
	n = N()
	up = ceil(sqrt(n))
	res = 1
	for i in range(2, up + 1):
		if n % i == 0:
			while n % i == 0:
				n //= i
			res *= i
			if n == 1:
				break
	else:
		res *= n
	print(res)
main()


n = int(input())
i = 2
tot = 1
r = n ** 0.5
while i <= r:
	if n % i == 0:
		while n % i == 0:
			n = n // i
		tot *= i
	i += 1
print(tot * n)


import sys
import string
import math
from collections import defaultdict
from functools import lru_cache
from collections import Counter
from fractions import Fraction

def mi(s):
	return map(int, s.strip().split())

def lmi(s):
	return list(mi(s))

def tmi(s):
	return tuple(mi(s))

def mf(f, s):
	return map(f, s)

def lmf(f, s):
	return list(mf(f, s))

def js(lst):
	return ' '.join((str(d) for d in lst))

def jsns(lst):
	return ''.join((str(d) for d in lst))

def line():
	return sys.stdin.readline().strip()

def linesp():
	return line().split()

def iline():
	return int(line())

def mat(n):
	matr = []
	for _ in range(n):
		matr.append(linesp())
	return matr

def matns(n):
	mat = []
	for _ in range(n):
		mat.append([c for c in line()])
	return mat

def mati(n):
	mat = []
	for _ in range(n):
		mat.append(lmi(line()))
	return mat

def pmat(mat):
	for row in mat:
		print(js(row))

def factorize(n):
	factors = []
	i = 2
	while i * i <= n:
		while n % i == 0:
			factors.append(i)
			n //= i
		i += 1
	if n > 1:
		factors.append(n)
	return factors

def main():
	n = iline()
	s = set(factorize(n))
	ans = 1
	for n in s:
		ans *= n
	print(ans)
main()


def div(num):
	length = 0
	sqrt = int(pow(num, 0.5))
	for i in range(2, sqrt + 1):
		if num % i == 0:
			left.append(i)
			right.insert(0, num // i)
			length += 2
	return length
n = int(input())
if n == 1:
	print(1)
else:
	left = []
	right = []
	l = div(n) + 1
	arr = left + right
	arr.append(n)
	start = 0
	end = -1
	while start <= end + l and arr[start] <= int(pow(arr[end], 0.5)):
		if arr[end] % (arr[start] * arr[start]) == 0:
			start = 0
			end -= 1
		else:
			start += 1
	print(arr[end])


n = int(input())
divs = [n, 1]
ra = int(n ** (1 / 2))
for s in range(2, ra + 1):
	if n % s == 0:
		divs.append(s)
		if s != int(n / s):
			divs.append(int(n / s))
divs.sort()
divs.reverse()
for q in divs:
	s = int(q ** (1 / 2))
	if q in [1, 2, 3]:
		print(q)
		break
	else:
		f = 1
		for p in range(1, s + 1):
			if q % p ** 2 == 0 and p != 1:
				f = 0
				break
		if f:
			print(q)
			break


n = int(input())
old_n = n
res = 1
for i in range(2, int(old_n ** 0.5) + 1):
	if n % i == 0:
		res *= i
	while n % i == 0:
		n //= i
if n > 1:
	res *= n
print(res)


import sys
import math
n = int(input())
ans = 1
s = int(math.sqrt(n))
for i in range(2, s + 1):
	while n % i == 0:
		n //= i
		if ans % i != 0:
			ans *= i
if ans % n != 0:
	ans *= n
print(ans)


def getfctrllist(n):
	A = [n]
	for i in range(2, int(n ** 0.5) + 1):
		if n % i == 0:
			if n // i == i:
				A.append(i)
			else:
				A.append(i)
				A.append(n // i)
	A.sort()
	return A
n = int(input())
A = getfctrllist(n)
p = len(A) - 1
i = 0
while i < p + 1:
	if A[p] % (A[i] * A[i]) == 0:
		p -= 1
		i = 0
		continue
	i += 1
print(A[p])


n = int(input())
divs = set()
div = 2
while div <= n ** 0.5:
	if n % div == 0:
		divs.add(div)
		n //= div
	else:
		div += 1
if n > 1:
	divs.add(n)
ans = 1
for div in divs:
	ans *= div
print(ans)


from functools import reduce
n = int(input())
limit = int(pow(n, 1 / 2)) + 1
primes = []
bs = [True] * limit

def sieve():
	bs[0] = False
	bs[1] = False
	for i in range(2, limit):
		if bs[i]:
			for j in range(i * i, limit, i):
				bs[j] = False
			primes.append(i)

def prime_factors():
	pfs = set()
	temp = n
	p_idx = 0
	while temp > 1 and p_idx < len(primes):
		prime = primes[p_idx]
		while temp % prime == 0:
			pfs.add(prime)
			temp //= prime
		p_idx += 1
	if temp > 1:
		pfs.add(temp)
	return pfs
sieve()
pfs = prime_factors()
ans = 1 if not pfs else reduce(lambda x, y: x * y, pfs)
print(ans)


n = int(input())
s = set()
for i in range(2, int(n ** 0.5) + 1):
	while n % i == 0:
		s |= {i}
		n //= i
s |= {n}
d = 1
for x in s:
	d *= x
print(d)


n = int(input())
div = {}
for i in range(2, 1000001):
	if n == 1:
		break
	if n % i == 0:
		div[i] = 0
	while n % i == 0:
		div[i] += 1
		n //= i
if n > 1:
	div[n] = 1
ans = 1
for (k, i) in div.items():
	ans = ans * k
print(ans)


import math as m
n = int(input())
a = int(m.sqrt(n))
ans = 1
if not n & 1:
	ans *= 2
	while not n & 1:
		n //= 2
i = 3
while i <= a:
	if n % i == 0:
		ans *= i
		while n % i == 0:
			n //= i
	i += 2
print(ans * n)


def get_primes(k):
	p = [True] * (k + 1)
	p[0] = False
	p[1] = False
	for i in range(1, k + 1):
		if p[i]:
			for j in range(2, k // i + 1):
				p[i * j] = False
	pr = []
	for i in range(k + 1):
		if p[i]:
			pr.append(i)
	return pr
n = int(input())
p = get_primes(1000500)
t = 1
for x in p:
	if n % x == 0:
		t *= x
		while n % x == 0:
			n = n // x
print(t * n)


from math import sqrt, ceil
n = int(input())
for i in range(2, ceil(sqrt(n)) + 1):
	while n % (i * i) == 0:
		n /= i
print(int(n))


(n, ans) = (int(input()), 1)
m = n
for x in range(2, round(m ** 0.5) + 2):
	if n % x == 0:
		ans *= x
		while n % x == 0:
			n //= x
print(ans * n)


n = int(input())
i = 1
div = []
while i <= n and i < 10 ** 6:
	if n % i == 0:
		div.append(i)
	i += 1
i = 1
while i < len(div):
	if n % div[i] ** 2 == 0:
		n //= div[i]
		i = 1
	else:
		i += 1
print(n)


from copy import copy
n = int(input())
factors = set()
new = copy(n)
for i in range(2, int(n ** (1 / 2)) + 1):
	while new % i == 0:
		factors.add(i)
		new //= i
if new != 1:
	factors.add(new)
ans = 1
for i in factors:
	ans *= i
print(ans)


import math
n = int(input())
realn = n
divisors = [-1]
if n % 2 == 0:
	divisors.append(2)
	while n % 2 == 0:
		n /= 2
x = 3
while x <= math.sqrt(n):
	(a, b) = divmod(n, x)
	if b == 0:
		n /= x
		divisors.append(x)
		while n % x == 0:
			n /= x
	x += 2
if n > 1:
	divisors.append(int(n))
if len(divisors) == 1:
	result = realn
else:
	result = 1
	for divisor in divisors[1:]:
		result *= divisor
print(result)


n = int(input())
a = []
while n != 1:
	i = 2
	border = len(str(n))
	if not border % 2:
		border = int('1' + border // 2 * '0')
	else:
		border = int('10' + border // 2 * '0')
	while n % i:
		i += 1
		if i > border:
			i = n
	if i not in a:
		a.append(i)
	n //= i
for i in a:
	n *= i
print(n)


from sys import stdin, stdout
from math import floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque
from heapq import merge, heapify, heappop, heappush, nsmallest
from bisect import bisect_left as bl, bisect_right as br, bisect
mod = pow(10, 9) + 7
mod2 = 998244353

def inp():
	return stdin.readline().strip()

def iinp():
	return int(inp())

def out(var, end='\n'):
	stdout.write(str(var) + '\n')

def outa(*var, end='\n'):
	stdout.write(' '.join(map(str, var)) + end)

def lmp():
	return list(mp())

def mp():
	return map(int, inp().split())

def smp():
	return map(str, inp().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(m, val) for j in range(n)]

def remadd(x, y):
	return 1 if x % y else 0

def ceil(a, b):
	return (a + b - 1) // b
S1 = 'abcdefghijklmnopqrstuvwxyz'
S2 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

def isprime(x):
	if x <= 1:
		return False
	if x in (2, 3):
		return True
	if x % 2 == 0:
		return False
	for i in range(3, int(sqrt(x)) + 1, 2):
		if x % i == 0:
			return False
	return True
num = iinp()
t = False
while not t:
	t = True
	for i in range(2, int(sqrt(num)) + 1):
		if num % (i * i) == 0:
			num = num // i
			t = False
			break
print(num)


from math import sqrt
n = int(input())
res = 1
k = 3
if n % 2 == 0:
	res *= 2
	while n % 2 == 0:
		n >>= 1
mark = False
while n > 1:
	if n % k == 0:
		res *= k
		while n % k == 0:
			n //= k
	k += 2
	if k > sqrt(n):
		mark = True
		break
if mark:
	res *= n
print(int(res))


n = int(input())
s = n
a = 1
for i in range(2, int(n ** 0.5 + 10)):
	if n % i == 0:
		a *= i
		while n % i == 0:
			n //= i
a *= n
print(a if a != 1 else s)


import os
import sys
from math import *
from collections import *
from fractions import *
from bisect import *
from heapq import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
n = Int()
ans = 1
flag = defaultdict(lambda : True)
for i in range(2, int(sqrt(n) + 3)):
	if n % i == 0:
		ans *= i
		while n % i == 0:
			n = n // i
ans *= n
print(ans)


import math
from bisect import bisect_right as br
import sys
input = sys.stdin.readline

def factors(n):
	l = []
	for i in range(1, int(n ** 0.5) + 1):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l
n = int(input())
l = factors(n)
sq = [0] * (int(n ** 0.5) + 1)
for i in range(1, int(n ** 0.5) + 1):
	sq[i] = i ** 2
l.sort(reverse=True)
ans = 1
for i in l:
	idx = br(sq, i)
	flag = True
	for j in range(2, idx):
		if i % sq[j] == 0:
			flag = False
			break
	if flag:
		ans = i
		break
print(ans)


import math
import sys

def is_prime(x):
	k = int(math.sqrt(x))
	for i in range(2, k + 1):
		if x % i == 0:
			return False
	return True

def deal(x, y):
	while x % y == 0:
		x /= y
	return x
n = int(input())
if is_prime(n):
	print(n)
	sys.exit(0)
div = set()
if n % 2 == 0:
	div.add(2)
	if is_prime(n // 2):
		div.add(n // 2)
k = int(math.sqrt(n))
for i in range(3, k + 1):
	if n % i == 0:
		if is_prime(i):
			div.add(i)
		if is_prime(n // i):
			div.add(n // i)
ans = 1
for i in div:
	ans = ans * i
print(ans)


s = set()

def primefact(n):
	while n % 2 == 0:
		s.add(2)
		n //= 2
	i = 3
	while i <= n ** 0.5:
		while n % i == 0:
			s.add(i)
			n //= i
		i += 2
	if n > 2:
		s.add(n)
n = int(input())
primefact(n)
ans = 1
for item in s:
	ans *= item
print(ans)


import math
n = int(input())
answer = 1
divisor = 2
while math.sqrt(n) >= divisor:
	if n % divisor == 0:
		answer *= divisor
		while n % divisor == 0:
			n = n / divisor
	divisor += 1
print(int(answer * n))


import math
import functools

def find_prime_factors(N):
	s = set([])
	while N % 2 == 0:
		N //= 2
		s.add(2)
	for i in range(3, int(math.sqrt(N)) + 1, 2):
		while N % i == 0:
			N //= i
			s.add(i)
	if N > 2:
		s.add(N)
	return s
num = int(input())
if num == 1:
	print(1)
else:
	s = find_prime_factors(num)
	prod = functools.reduce(lambda a, b: a * b, list(s))
	print(prod)


a = int(input())

def primes(n):
	primfac = []
	d = 2
	while d * d <= n:
		while n % d == 0:
			primfac.append(d)
			n //= d
		d += 1
	if n > 1:
		primfac.append(n)
	return primfac
prod = 1
for i in set(primes(a)):
	prod *= i
print(prod)


from sys import exit
from math import sqrt, floor, ceil
MAX_PRIME = int(sqrt(1000000000000.0))
n = int(input())
out = 1
(sieve_last, sieve_b) = (1, [True] * (MAX_PRIME + 1))
i = 2
while i <= int(sqrt(MAX_PRIME) + 500):
	k = sieve_last
	while k < min(i ** 2, MAX_PRIME):
		if sieve_b[k] and sieve_last != k:
			sieve_last = k
			if n % k == 0:
				while n % k == 0:
					n = n // k
				out *= k
			if n == 1:
				print(out)
				exit(0)
		k += 1
	while k <= MAX_PRIME:
		sieve_b[k] = False
		k += i
	i += 1
	while sieve_b[i] != True:
		i += 1
print(n * out)


n = int(input())
i = 2
resp = 1
fact = []
while i * i <= n:
	if n % i:
		i += 1
	else:
		n //= i
		if fact.count(i) == 0:
			fact.append(i)
			resp *= i
if n > 1:
	if fact.count(n) == 0:
		resp *= n
print(resp)


n = int(input())
from math import sqrt as S
ans = 1
for i in range(2, int(S(n)) + 1):
	if n % i == 0:
		ans *= i
		while n % i == 0:
			n = n // i
if n > 1:
	ans *= n
print(ans)


n = int(input())
divisorsNo = []
i = 2
while i * i <= n:
	if n % i == 0:
		divisorsNo.append(i)
		n = int(n / i)
	else:
		i = i + 1
if n > 1:
	divisorsNo.append(n)
st = set(divisorsNo)
ans = 1
for i in st:
	ans = ans * i
print(ans)


from math import sqrt
x = int(input())
lol = []
for i in range(1, int(sqrt(x)) + 1):
	if x % i == 0:
		if x // i == i:
			lol.append(i)
		else:
			lol.append(x // i)
			lol.append(i)
lol.sort()
for i in lol[::-1]:
	f = 0
	for j in range(2, int(sqrt(i)) + 1):
		if i % j ** 2 == 0:
			f = 1
			break
	if f == 0:
		print(i)
		break


import math
n = int(input())

def printDivisors(n):
	c = []
	i = 1
	while i <= math.sqrt(n):
		if n % i == 0:
			if n / i == i:
				c.append(i)
			else:
				c.append(i)
				c.append(n / i)
		i = i + 1
	return c
c = sorted(printDivisors(n))
c.reverse()
for i in range(len(c)):
	k = 0
	for j in range(2, int(math.sqrt(c[i])) + 2):
		if int(c[i]) % pow(j, 2) == 0:
			k += 1
			break
	if k == 0:
		print(int(c[i]))
		break


import math
n = int(input())
i = 2
while i < int(pow(n, 1 / 2)) + 1:
	yep = False
	while n % i == 0:
		n //= i
		yep = True
	if yep:
		n *= i
	i += 1
print(n)


from sys import stdin
from collections import defaultdict
import sys
sys.setrecursionlimit(15000)

def get_prime():
	seive = [True] * (10 ** 6 + 1)
	for i in range(2, 10 ** 6 + 1):
		if seive[i] == True:
			for j in range(i * i, 10 ** 6 + 1, i):
				seive[j] = False
	prime = []
	for i in range(2, 10 ** 6 + 1):
		if seive[i] == True:
			prime.append(i)
	return prime
n = int(stdin.readline().strip())
cn = n
prime = get_prime()
factors = [0] * (10 ** 6 + 1)
flag = 0
for i in prime:
	while n % i == 0:
		flag = 1
		factors[i] += 1
		n //= i
ans = 1
for i in range(2, len(factors)):
	if factors[i] != 0:
		ans *= i
print(ans * n)


def main():
	n = int(input())
	d = 2
	n1 = n
	ans = 1
	while d * d <= n:
		if n1 % d == 0:
			ans *= d
		while n1 % d == 0:
			n1 //= d
		d += 1
	if n1 > 1:
		ans *= n1
	print(ans)
main()


n = int(input())
for i in range(2, int(n ** 0.5) + 1):
	while not n % (i * i):
		n = n // i
print(n)


n = int(input())
import math
arr = []
for i in range(1, int(math.sqrt(n)) + 1):
	if n % i == 0:
		arr.append(i)
		arr.append(n // i)
arr = sorted(arr, reverse=True)
for i in range(len(arr)):
	cnt = 0
	for j in range(2, int(math.sqrt(arr[i])) + 1):
		if arr[i] % pow(j, 2) == 0:
			break
		else:
			cnt += 1
	if cnt == int(math.sqrt(arr[i])) - 1:
		print(arr[i])
		break


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
import copy
import time
starttime = time.time()
mod = int(pow(10, 9) + 7)
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def L():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
try:
	sys.stdin = open('input.txt', 'r')
except:
	pass

def pmat(A):
	for ele in A:
		print(ele, end='\n')
prime = [1 for i in range(10 ** 6 + 10)]
for i in range(2, 10 ** 6 + 2):
	if prime[i] == 0:
		continue
	for j in range(i + i, 10 ** 6 + 10, i):
		prime[j] = 0
n = L()[0]
for i in range(2, int(n ** 0.5) + 1):
	if prime[i] and n % i == 0:
		while n % i == 0:
			n //= i
		n *= i
print(n)
endtime = time.time()