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 a2 is a divisor of x.  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.

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

NoteIn 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 = 22, so 12 is not lovely, while 6 is indeed lovely.

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)

from math import sqrt as sq
n=input()
g=n
res=1
i=3
c=0
while n%2==0:
    g/=2
    n/=2
    c+=1
if c>0:
    g*=2

while i*i<=g:
    c=0
    while n%i==0:
        g/=i
        n/=i
        c+=1
    if c>0:
        g*=i
    i+=2
print g

from copy import copy
n = int(input())
factors = set()

new = copy(n)
for i in range(2, int(n**(1/2))+1):
    #print(i)
    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)

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

n = input()

s = prime_factors(n)
s = set(s)
ans = 1
for i in s:
    ans*=i
print ans

n = int(raw_input())

ans = 1
i = 2
while i*i <= n:
    if n%i==0:
        ans *= i
        while n%i==0:
            n = n/i
    i += 1
ans *= n
print ans

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

import math

num = int(input())
lovely = 1

for i in range(2, int(math.sqrt(num)) + 1):
    if num % i == 0:
        lovely *= i
        num //= i
        while(num % i == 0):
            num //= i

if num > 1:
    lovely *= num

print(lovely)

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 factorize(n).items():
    result *= k
print(result)

#duff_in_love

m = int(raw_input())

result = 1
toCheck = 2

while toCheck * toCheck <= m:
	if m % toCheck == 0:
		result *= toCheck
		while(m % toCheck == 0):
			m /= toCheck
	toCheck += 1

if m > 1: result *= m

print result

n=int(raw_input())
t=2
ans=1

while t*t<=n:
    if n%t==0:
        ans*=t
        while n%t==0:
            n/=t
    t+=1
if n>1:
    ans*=n
print ans

num = int(raw_input())
i = 2
while  i < int(num**0.5 + 1):
	if num % ((i * i)) == 0:
		num /= i
	else :
		i += 1

print num

# -*- coding: utf-8 -*-

import math

def read_int():
    return int(raw_input())

def read_int_list():
    return map(int, raw_input().split())

if __name__ == '__main__':
    n = read_int()
    factors = set()

    i = 2
    while n > 1 and i <= int(math.sqrt(n)) + 1:

        if n % i == 0:
            factors.add(i)

        while n % i == 0:
            n /= i

        i += 1

    result = n

    for i in factors:
        result *= i

    print result

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)

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))
#print(n)
for i in range(2,int(n**(0.5))+1):
    x=math.log(n,i)
    #print(x)
    if n%i==0 :
        j=int(x)+1
        while(j>=2):
            if n%(i**j)==0:
                y+=1
                #print(y)
            j-=1
        n/=(i**(y))
        y=0
print(int(n))

import math
a=[]
for i in range(2,1000001):
	a.append(i*i)

def bsearch(n):
	l = 0
	h = len(a)
	while l<=h:
		m = (l+h)/2
		if a[m]>n:
			h = m-1
		elif a[m]<n:
			l = m+1
		else:
			return True
	return False

n = input()
s = int(math.sqrt(n)+1)

f = {}
sf = set()
for i in range(1,s):
	if n%i==0:
		f[i]=0
		f[n/i]=0
		sf.add(i)
		sf.add(n/i)
sfl = sorted(sf)
res = -1
for x in sfl:
	if f[x]==0 and bsearch(x):
		for y in sfl:
			if y%x == 0:
				f[y]=1
	elif f[x]==0:
		if x>res:
			res = x
print(res)

from math import sqrt
num = raw_input()
num = int(num)
i = 1
for j in xrange(2, int(sqrt(num)) + 1):
    if num % j == 0:
        i *= j
        while (num % j == 0):
            num /= j
if num > 1:
    i *= num
print i

#########			##	##     ##    	  ####  #####  ##     #  ##     #		##
	#			   # #	# #   # #		 #	  #	#	#  # #    #  # #    #	   # #
	#			  #  #	#  ###  #	    #		#	#  #  #   #  #  #   #	  #  #
	#			 #####	#	#	#	   #    ###	#	#  #   #  #  #   #  #    #####
	#			#    #	#		#	   #    # #	#	#  #	# #  #	  # #   #    #
######### 	   #     # 	#		#		##### #	#####  #	 ##  #	   ##  #     #

"""

PPPPPPP       RRRRRRR		    OOOO	  VV        VV    EEEEEEEEEE
PPPPPPPP      RRRRRRRR         OOOOOO     VV       VV	  EE
PPPPPPPPP     RRRRRRRRR       OOOOOOOO    VV      VV	  EE
PPPPPPPP      RRRRRRRR        OOOOOOOO    VV     VV    	  EEEEEE
PPPPPPP       RRRRRRR         OOOOOOOO    VV    VV        EEEEEEE
PP  		  RRRR			  OOOOOOOO    VV   VV         EEEEEE
PP			  RR  RR          OOOOOOOO    VV  VV          EE
PP			  RR    RR         OOOOOO     VV VV           EE
PP			  RR      RR        OOOO      VVVV            EEEEEEEEEE

"""

"""
 Perfection is achieved not when there is nothing more to add, but rather when there is nothing more to take away.
"""
import sys
input = sys.stdin.readline
# from bisect import bisect_left as lower_bound;
# from bisect import bisect_right as upper_bound;
# from math import ceil, factorial;

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

# swap_array function
def swaparr(arr, a,b):
    temp = arr[a];
    arr[a] = arr[b];
    arr[b] = temp;

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

## nCr function efficient using Binomial Cofficient
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);

## upper bound function code -- such that e in a[:i] e < x;
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;

## prime factorization
def primefs(n):
    ## if n == 1    ## calculating primes
    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
    ## prime factoriazation of n is stored in dictionary
    ## primes and can be accesed. O(sqrt n)
    return primes

## MODULAR EXPONENTIATION FUNCTION
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

## DISJOINT SET UNINON FUNCTIONS
def swap(a,b):
    temp = a
    a = b
    b = temp
    return a,b;

# find function with path compression included (recursive)
# def find(x, link):
#     if link[x] == x:
#         return x
#     link[x] = find(link[x], link);
#     return link[x];

# find function with path compression (ITERATIVE)
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;

# the union function which makes union(x,y)
# of two nodes x and y
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

## returns an array of boolean if primes or not USING SIEVE OF ERATOSTHANES
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

#### PRIME FACTORIZATION IN O(log n) using Sieve ####
MAXN = int(1e5 + 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;
    ## function for storing smallest prime factors (spf) in the array

################## un-comment below 2 lines when using factorization #################
spf = [0 for i in range(MAXN)]
# spf_sieve();
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
    ## this function is useful for multiple queries only, o/w use
    ## primefs function above. complexity O(log n)

## taking integer array input
def int_array():
    return list(map(int, input().strip().split()));

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

## taking string array input
def str_array():
    return input().strip().split();

#defining a couple constants
MOD = int(1e9)+7;
CMOD = 998244353;
INF = float('inf'); NINF = -float('inf');

################### ---------------- TEMPLATE ENDS HERE ---------------- ###################

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)

if __name__ == '__main__':
	for _ in range(1):
		solve()
	# fin_time = datetime.now()
# 	print("Execution time (for loop): ", (fin_time-init_time))

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

from math import sqrt

def fatoraNumero(N):
	resto = N
	divisor = 2
	maior = 1
	novo = True
	while resto >= 0 and divisor <= int(sqrt(N)):
		if (resto % divisor == 0):
			if novo:
				maior *= divisor
				novo = False

			resto = resto / divisor
		else:
			divisor += 1
			novo = True

	if (resto > 1):
		maior *= resto

	return maior

N = int(raw_input())

print fatoraNumero(N)

__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)

v = int(raw_input())
resposta = 1
t = 2
while t**2 <= v:
	if v % t == 0:
		resposta *= t
	while v % t == 0:
		v /= t
	t+=1
if v > 1:
	resposta *= v
print resposta

import math
MAX = 10 ** 6
eh_primo = [True] * (MAX + 1)
eh_primo[0] = False
eh_primo[1] = False
primos = []

for i in xrange(2, int(MAX)+1):
    if eh_primo[i]:
        for j in xrange(2*i, int(MAX) + 1, i):
            eh_primo[j] = False
        primos.append(i)

a = int(raw_input())
soma = 1
for e in primos:
    if a % e == 0:
        soma *= e
    while a % e == 0:
        a = a / e
print soma * a

n = int(raw_input())
s = set([1])

i = 2
while n != 1 and i * i <= n:
    while n % i == 0:
        s.add(i)
        n /= i
    i += 1

s.add(n)

print reduce(lambda x, y: x * y, list(s))

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

print(n)

#coding: utf-8
entrada1 = int(raw_input())

limite = 1000000
primos = []
def encontra_primos():
    primos = [0] * limite
    primos[0] = primos[1] = 1
    for i in range(2, limite):
        if primos[i] == 0:
            for j in range(i*i, limite, i):
                primos[j] = j
    return primos

primosx = encontra_primos()
for i in range(len(primosx)):
	if primosx[i] == 0:
		primos.append(i)
x = []
now = 0
y = entrada1
while y > 1:
	if y % primos[now] == 0:
		x.append(primos[now])
		while y % primos[now] == 0:
			y = y / primos[now]
	now += 1
	if now == len(primos):
		x.append(y)
		break
result = 1
for i in range(len(x)):
	result *= x[i]

print result

primes = []
aux = [True for i in range(1000010)]

def crivos(num):
    for i in range(2,num):
        if aux[i]:
            for j in range(i * i, num, i): aux[j] = False
            primes.append(i)

crivos(1000010)

def fatorar(num):
    fatores = []
    index, pf = 0, primes[0]
    while num != 1 and (pf*pf) <= num:
        while num%pf == 0:
            num /= pf
            fatores.append(pf)
        index += 1
        pf = primes[index]
    if num != 1: fatores.append(num)
    return fatores

num = int(raw_input())
foat = set(fatorar(num))
resp = 1
for i in foat: resp *= i
print resp

n = int(raw_input())
t = 2
resp = 1

while t * t <= n:

	if n % t == 0:

		resp *= t

		while n % t == 0:
			n /= t

	t += 1

if n > 1:

    resp *= n

print resp

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)
#print(l)
for i in range(len(l)):
    x=countPerfectDivisors(l[i])
    #print(x)
    if x==1:
        ans=l[i]
        break
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

def factorize_primes(n):
    """Return prime factorization of `n`"""

    s = math.sqrt(n)
    s = int(s)

    d = 2
    F = []
    while True:
        if d > s:
            F.append(n) # n is prime
            break
        elif n % d:
            d += 1
            continue

        F.append(d)
        n /= d
        s = math.sqrt(n)
        s = int(s)

    return F

if __name__ == '__main__':
    n = int(raw_input())

    max_lucky = 1
    F = factorize_primes(n)
    for d in set(F):
        max_lucky *= d

    print max_lucky

from math import sqrt

def divs(n):
    i = 2
    while i*i <= n:
        if n%(i*i)==0:
            return divs(n/i)
        i+=1
    return n

n = input()
ans = divs(n)
print ans

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 14 10:47:25 2020

@author: shailesh
"""
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)

n = int(raw_input())
ans = 1
for i in xrange(2, 1000000):
    if i>n: break
    if n%i != 0: continue
    ans *= i
    while n%i == 0: n = n/i
print ans*n

num = input()

fac = {}

d = 2
n = num
while (d*d<=n):
    while n%d==0:
        try:
            fac[d]+=1
        except:
            fac[d]=1
        n/=d
    d+=1
if n>1:
    try:
        fac[n]+=1
    except:
        fac[n]=1

ans = 1
for x in fac:
    ans*=x
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)

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()

num = int(raw_input())
divisores = 1

for i in xrange(2, int(num ** 0.5) + 1):
    if num == 1:
        break
    while True:
        if num % i == 0:
            num /= i
            if divisores % i != 0:
                divisores *= i
        else:
            break
if num != 1:
	divisores *= num
print divisores

from copy import copy
n = int(input())
factors = set()

new = copy(n)
for i in range(2, int(n**(1/2))+1):
    #print(i)
    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)

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)

from math import sqrt
num = int(raw_input())
i = 1
for j in xrange(2, int(sqrt(num)) + 1):
    if num % j == 0:
        i *= j
        while (num % j == 0):
            num /= j
if num > 1:
    i *= num
print i

def rwh_primes2(n):
    # http://stackoverflow.com/questions/2068372/fastest-way-to-list-all-primes-below-n-in-python/3035188#3035188
    """ Input n>=6, Returns a list of primes, 2 <= p < n """
    correction = (n%6>1)
    n = {0:n,1:n-1,2:n+4,3:n+3,4:n+2,5:n+1}[n%6]
    sieve = [True] * (n/3)
    sieve[0] = False
    for i in xrange(int(n**0.5)/3+1):
      if sieve[i]:
        k=3*i+1|1
        sieve[      ((k*k)/3)      ::2*k]=[False]*((n/6-(k*k)/6-1)/k+1)
        sieve[(k*k+4*k-2*k*(i&1))/3::2*k]=[False]*((n/6-(k*k+4*k-2*k*(i&1))/6-1)/k+1)
    return [2,3] + [3*i+1|1 for i in xrange(1,n/3-correction) if sieve[i]]

P = rwh_primes2(1000010)

N = int(raw_input())

B = 1
found = False
for p in P:
    if N % p == 0:
        B *= p
    while N % p == 0:
        N /= p
    if N == 1:
        break

print N*B

n = int(input())

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

print(n)

#!/bin/python3
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)

n = int(input())

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

print(out)

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)

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))

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}))

from math import sqrt

def divs(n):
    i = 2
    while i*i <= n:
        if n%(i*i)==0:
            return divs(n/i)
        i+=1
    return n

n = input()
ans = divs(n)
print ans

from math import sqrt
n = long(raw_input())

def lovely_number(n):
    j = 1
    for i in xrange(2, int(sqrt(n))+1):
        if n % i == 0:
            j *= i
            while (n % i == 0):
                n /= i
    if n > 1:
        j *= n

    return j

print lovely_number(n)

# @author Matheus Alves dos Santos

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))

import math
n = int(input())

ans = 1
upper = int(math.sqrt(n))
for i in range(2, upper + 1):
    if n % i == 0:
        ans *= i
        while n % i == 0:
            n /= i

ans *= n
print(int(ans))

import math
n = int(raw_input())

divisores = []
divisoresQuadrados = []
for i in range(2, int(math.sqrt(n)) +2):
	quadrado = i**2
	if(quadrado <= n and n % quadrado ==0):
		divisoresQuadrados.append(quadrado)
	if(n % i == 0):
		if i not in divisores:
			divisores.append(i)
		if n/i not in divisores:
			divisores.append(n/i)

divisores.append(n)
divisores.sort()
divisoresQuadrados.sort()

for i in divisores[::-1]:
	lovelyNumber = True
	for j in divisoresQuadrados:
		if i % j == 0:
			lovelyNumber = False
	if lovelyNumber:
		print i
		break

from math import sqrt
import sys
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)))
t=input()
if(t==1):
    print "1"
    sys.exit(0)
z=list(factors(t))
z=sorted(z,reverse=True)
f=0
for i in range(len(z)-1):
    f=0
    k=z[i]
    for j in range(i+1,len(z)-1):
        d=z[j]*z[j]
        if(k%d==0):
            f=1
            break
    if(f==0):
        print k
        break

import math

def divisor(n, x):
	for i in range (2, int(math.sqrt(x)) + 1):
		if(x%i == 0):
			n.append(i)

	for i in range(len(n)-1,-1,-1):
		if(n[i] == x/n[i]):
			continue
		n.append(x/n[i])
	n.append(x)

x = input()
maior = 0

v = []
divisor(v,x)
if(len(v) == 0 or x == 1):
	maior = x

else:

	for i in xrange(len(v)-1,-1,-1):

		if(pow(int(math.sqrt(v[i])),2) == v[i]):
			continue
		x = v[i]

		h = []
		divisor(h,x)

		j = len(h) - 1
		while(j>=0):

			if(pow(int(math.sqrt(h[j])),2) == h[j]):
				maior = 0
				x = v[i]
				break
			j = j-1
			maior = x

		if(x == maior):
			break

print maior

def primes(n):
    pows = []
    d = 2
    while d*d <= n:
        p = 0
        while n % d == 0:
            n /= d
            p += 1
        if p > 0:
            pows.append(d)
            #pows.append([d, p])
        d += 1
    if n > 1:
        pows.append(n)
        #pows.append([n, 1])
    return pows
#print len(primes(1000000000000))
n = input()
l = primes(n)
#print l
ans = 1
for i in xrange(len(l)):
    ans *= l[i]
    #if l[i][1]%2 == 0:
    #   ans *= pow(l[i][0], l[i][1]-1)
    #else:
    #   ans *= pow(l[i][0], l[i][1])
print ans

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))
#print(n)
for i in range(2,int(n**(0.5))+1):
    x=math.log(n,i)
    #print(x)
    if n%i==0 :
        j=int(x)+1
        while(j>=2):
            if n%(i**j)==0:
                y+=1
                #print(y)
            j-=1
        n/=(i**(y))
        y=0
print(int(n))

num = int(raw_input())
divisores = 1

for i in xrange(2, int(num ** 0.5) + 1):
    if num == 1:
        break
    while True:
        if num % i == 0:
            num /= i
            if divisores % i != 0:
                divisores *= i
        else:
            break
if num != 1:
	divisores *= num
print divisores

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

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))

n = int(raw_input())

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

n = int(input())

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

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

############ ---- Input Functions ---- ############
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)

# coding: utf-8

import math

num = int(raw_input())

raiz = int(math.sqrt(num))
div = []

for i in xrange(1, raiz + 1):
	if num % i == 0:
		div.append(i)
		div.append(num / i)

div = sorted(div)

tam = len(div) - 1
i = tam
lovely = 1

while True:
	if i < 0:		break

	j, check = 1, False
	while True:
		if j > tam:		break

		aux = div[j] ** 2

		if aux <= div[i]:
			if div[i] % aux == 0:
				check = False
				break
			else:	check = True
		else:
			check = True
			break

		j += 1

	if check:
		lovely = div[i]
		break

	i -= 1

print lovely

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)

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())))

#duff_in_love

m = int(raw_input())

result = 1
toCheck = 2

while toCheck * toCheck <= m:
	if m % toCheck == 0:
		result *= toCheck
		while(m % toCheck == 0):
			m /= toCheck
	toCheck += 1

if m > 1: result *= m

print result

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))

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
n = input()
if n < 2:
	print n
else:
	for i in xrange(2, int(sqrt(n))+1):
		while n % (i*i) == 0 and n >= i*i:
			n //= i
	print n

#fin=open("input.txt","r")

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

#fin.close()

from math import sqrt as sq
n=input()
g=n
res=1
i=3
c=0
while n%2==0:
    g/=2
    n/=2
    c+=1
if c>0:
    g*=2

while i*i<=g:
    c=0
    while n%i==0:
        g/=i
        n/=i
        c+=1
    if c>0:
        g*=i
    i+=2
print g

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

main()

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

from math import sqrt
num = int(raw_input())
i = 1
for j in xrange(2, int(sqrt(num)) + 1):
    if num % j == 0:
        i *= j
        while (num % j == 0):
            num /= j
if num > 1:
    i *= num
print i

#coding: utf-8

n = int(raw_input())

i = 2
res = 1

while ((i**2) <= n):

	if (n % i == 0):
		res *= i

		while (n % i == 0):
			n /= i

	i += 1

if (n > 1):
	res *= n

print res

# X % (a**2) != 0
# time complexity is sqrt(n)* logn
# I hope with this time complexity, i will be not facing with time limit :(
def check(num):
	# num = m*(a**2)
	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(raw_input())

numb = 2
valor = 1
while (numb**2 <= n):
	if (n % numb == 0):
		valor = valor * numb
		while (n % numb == 0):
			n = n / numb
	numb = numb + 1

if (n > 1):
	valor = valor * n

print valor

from math import sqrt

__author__ = 'aste'

n = int(raw_input())
r = 1
i = 2
while i <= sqrt(n):
    if n % i == 0:
        r *= i
        while n % i == 0:
            n /= i
    i += 1
r *= n
print r

import sys,math
from math import ceil,sqrt
from math import ceil
input=sys.stdin
write=sys.stdout.write
n=int(input.readline())
final=1
a=n
for m in range(2,int(ceil(sqrt(a+0.0)))+1):
    if n%m==0:
        k=1
        while n%(m**(2))==0:
            n=n//m
        n=n//m
        final*=m
final*=n
write(str(final))

n = 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 ans

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=input()
m=n**0.5+1
i=2
li=[]
while(i<m):
    if(n%i==0):
        n/=i
        if i not in li:
            li+=[i]
        i=2
        m=n**0.5+1
    else:
        i+=1

if n not in li:
    li+=[n]
a=1
for i in li:
    a*=i
print a

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)

def ok(x):
	a = 2
	while a * a <= x:
		if x % (a*a) == 0:
			return False
		a+=1
	return True

import math
lista = []
x = int (raw_input())

for i in range(1,int(math.sqrt(x))+1):
	if x % i == 0:
		k = x / i
		lista.append(k)
		lista.append(i)
lista.sort()
lista.reverse()
vetor  = 0
for l in range(len(lista)):
	if ok(lista[l]) == True:
		k = lista[l]
		vetor = max(vetor,k)
print vetor

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)

if __name__ == "__main__":
    main()

#In the name of Allah

from sys import stdin, stdout
input = stdin.readline

from math import sqrt
from time import time

def prd(n):
        T = time()
        N = n
        pr = set()
        i = 2
        while n > 1 and time() - T < 1.9:
                if n % i == 0:
                        pr.add(i)
                while n % i == 0:
                        n /= i
                i += 1

        return pr

n = int(input())
pr = prd(n)
ans = 1

for i in pr:
        ans *= i

stdout.write(str(ans))

import math

while 1:
    try: n=int(input())
    except: break
    ds=[i for i in range(1,int(math.sqrt(n))+1)]\
      +[n//i for i in range(1,int(math.sqrt(n))+1)]
    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

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):
    k = 2
    dels = []
    if curr == 1:
        dels.append((1,1))
    else:
        limit = int(curr**0.5) + 1
        while (curr != 1) & (k <= limit + 1):
            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)))

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author  : Napoleon
# @Mail    : tyfdream@163.com
# @Data    : 2015-07-22 11:40:35
# @Version : python 2.7
import math
n = int(raw_input())
ans = 1
s = 2

while s*s <= n:
    if n % s == 0:
        ans *= s
        while n % s == 0 :
            n /= s
    s += 1

print ans

n = int(raw_input())

primes = [True for i in range(0,1000001)]

ans = 1

for i in range(2,1000001):
    if primes[i]:
        if n%i == 0:
            ans *= i
        j = i
        while j <= 1000000:
            primes[j] = False
            j += i

print ans

#!/usr/bin/env python3

n = int(input())

def is_prime(x):
    for i in range(2, int(x ** 0.5) + 1):
        if x % i == 0:
            return False
    return True

res = 1
for i in range(2, n // 2 + 1):
    if n % i == 0 and is_prime(i):
        res *= i
print(res)

n = int(input())

l = list(range(2,100001))
i = 0
while i <= len(l)-1:
    div = l[i]
    if n%(div**2) == 0:
        n = n//div
    else:
        i+=1

print(n)

n=int(input())
d=1
for i in range(2,int(n**.5)+1):
    if n%i==0:
        d*=i
        while n%i==0:n//=i
print(d)

import math
n=input()
x=1
cond=True
final=n
while (n%x==0 and cond )and x<=n:
    div1=int(math.sqrt(n/x))
    for y in xrange(2,div1+1):
        if (n/x)%(y*y)==0:
            break
        elif y==div1:
            final=(n/x)
            cond=False
            break
    x+=1
print final

#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2016 missingdays <missingdays@missingdays>
#
# Distributed under terms of the MIT license.

"""

"""

import math

n = int(input())

i = 2

while i < int(pow(n, 1/2)) + 1:
    if n % i == 0:
        n //= i

        if n % i != 0:
            n *= i

    i += 1

print(n)

primes = []
aux = [True for i in range(1000000)]

def crivos(num):
    for i in range(2,num):
        if aux[i]:
            for j in range(i * i, num, i): aux[j] = False
            primes.append(i)

crivos(1000000)

def fatorar(num):
    fatores = []
    index, pf = 0, primes[0]
    while num != 1 and (pf*pf) <= num:
        while num%pf == 0:
            num /= pf
        fatores.append(pf)
        index += 1
        pf = primes[index]
    if num != 1: fatores.append(num)
    return fatores

num = int(raw_input())
foat = fatorar(num)
resp = 1
for i in foat: resp *= i
print resp

def Factor(n):
    Ans = 1
    d = 2
    kor = int(n ** 0.5) + 2
    used = [False for i in range(kor)]

    while d * d <= n:
        if n % d == 0:
            if (not used[d]):
                Ans *= d
            used[d] = True
            n //= d
        else:
            d += 1
    if n > 1:
        if n < kor and not used[n]:
            Ans *= n
        elif n > kor:
            Ans *= n

    return Ans

print(Factor(int(input())))

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():
    temp = i - (1 if i % 2 == 0 else 0)
    for p in range(temp):
        ans = ans * k
print(ans)

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)

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()), {1}

for d in PRIMES:
    while n % d == 0:
        D.add(d)
        n //= d
    if n == 1:
        break

print(reduce(mul, D))

import math
n = int(input())

def isLovely(item):
    s = 2
    e = 10**12

    while (s<e):
        m = (s+e)//2
        if item%(m**2) == 0:
            return False
        elif item/(m**2)> 0:
            e = m-1
        else:
            s = m+1
    return True
if isLovely(n):
    print(n)
else:
    items = []

    for i in range(1,int(n**0.5)+1):
        if n%i  == 0:
            item1 = i
            item2 = n//i
            if isLovely(item2):
                print(item2)
                break
            if isLovely(item1):
                items.append(item1)
    else:
        print(max(items))

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

n=int(input())
m=n
i=2
count=0
flag=0
while(count<=n):
    count=i**2
    if(n%count==0):
        n//=2
        i-=1
    i+=1
if(m==n):
    print(m)
else:
    print(n)

import math
n = int(input())

def isLovely(item):
    s = 2
    e = math.ceil(math.sqrt(10**12))

    while (s<e):
        m = (s+e)//2
        if item%(m**2) == 0:
            return False
        elif item/(m**2)> 0:
            e = m-1
        else:
            s = m+1
    return True
if isLovely(n):
    print(n)
else:
    items = []

    for i in range(1,int(n**0.5)+1):
        if n%i  == 0:
            item1 = i
            item2 = n//i
            if isLovely(item2):
                print(item2)
                break
            if isLovely(item1):
                items.append(item1)
    else:
        print(max(items))

from math import sqrt

def issquare(apositiveint):
  x = apositiveint // 2
  seen = set([x])
  while x * x != apositiveint:
    x = (x + (apositiveint // x)) // 2
    if x in seen: return False
    seen.add(x)
  return True

def main():
	n = input()
	div = []

	ranges = range(1, int(sqrt(n))+1)
	ranges.sort(reverse = True)

	for i in ranges:
		if(n % i == 0 and (i not in div) and (n/i not in div)):
			if(i > 1):
				div.append(i)
			if(n/i > 1):
				div.append(n/i)
	div.sort(reverse = True)
	condition = 0
	#print div
	#print int(sqrt(div[0]) + 1)

	for i in div:
		condition = 0
		reqd_range = range(2, int(sqrt(i)) + 2)

		if(i not in reqd_range):
			reqd_range.append(i)

		for j in reqd_range:
			if(i % j == 0):
				#print j, issquare(j)
				if(issquare(j)):
					condition = 1
					break

		if(condition == 0):
			print i
			break

main()

import math

def isLovely(num):
    lovely = True
    for j in range(2, int(math.sqrt(num))):
        if num % (j*j) == 0:
            lovely = False
            break

    return lovely

num = int(input())
lovely = 1

if (num % 2) == 0:
    for i in range(2, num + 1):
        if num % i == 0:
            if isLovely(i):
                lovely = i

else:
    for i in range(3, num + 1, 2):
        if num % i == 0:
            if isLovely(i):
                lovely = i
print(lovely)

n=input()
m=n**0.5+1
i=2
li=[]
while(i<m):
    if(n%i==0):
        n/=i
        if i not in li:
            li+=[i]
        i=2
        m=n**0.5
    else:
        i+=1
if n not in li:
    li+=[n]
a=1
for i in li:
    a*=i
print a

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
for i in range(p+1):
    if(A[p]%(A[i]*A[i])==0):
        p-=1
print(A[p])

from math import sqrt
import sys
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)))
t=input()
z=list(factors(t))
z=sorted(z,reverse=True)
for i in range(len(z)-1):
    k=z[i]*z[i]
    for j in range(i+1,len(z)):
        if(k%z[j]==0):
            r=1
            print int(sqrt(k))
            sys.exit(0)

n=input()
import math
a =  [i**2 for i in range(2,int(math.sqrt(n)),1) ]
for i in range(n,0,-1):
    if n%i==0:
        temp= True
        for j in a:

            if i%j==0:
                temp=False
        if temp:
            print i
            break

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():
#     temp = i - (1 if i % 2 == 0 else 0)
#     for p in range(temp):
#         ans = ans * k
# print(ans)
for i in range(2, 1000001):
    if n % (i * i) == 0:
        n //= i
print(n)

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

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(prod)

isprime = [True]*10**6
for i in range(2,10**6):
    if isprime[i]:
        j = 2
        while i*j < 10**6:
            isprime[i*j] = False
            j += 1
prime = [i for i in range(2,10**6) if isprime[i]]
n = input()
prime_factors = set()
i = 0
while n > 1 and i < len(prime):
    if n%prime[i] != 0:
        i += 1
    else:
        prime_factors.add(prime[i])
        n = n/prime[i]
ans = 1
for i in prime_factors:
    ans = ans*i
print ans

import math

num = int(raw_input())
fact = []

i = 2;

while num != 1:
    if not num % i:
        fact.append(i)
        num = num / i
    else: i += 1

div = [1]

for pA in range(len(fact)):
    for j in range(len(div)):
        nmb = fact[pA] * div[j]
        if not nmb in div:
            div.append(nmb)

div.sort(reverse=True)
for i in div:
    for j in range(2, int(math.ceil(math.sqrt(i)))):
        if not i % j ** 2 and j ** 2 in div:
            break
    else:
        print i
        break

__author__ = 'pxy'
import time
n=int(input())
t=2
e=n
z=1
q=1
w=True
b=True
x=time.time()
while q<=n and t<=n:
    if n%t==0:
        q=q*t
        while (n//t)%t==0:
            n=n//t
    if t>=5:
        t=t+2
    else:
        t=t+1
    if time.time()-x>1.8:
        print(e)
        w=False
        break
#y=time.time()
if w==True:
    print(n)

import math

def isLovely(num):
    lovely = True
    for j in range(2, int(math.sqrt(num))):
        if num % (j*j) == 0:
            lovely = False
            break

    return lovely

num = int(input())
lovely = 0

if (num % 2) == 0:
    for i in range(2, num + 1):
        if num % i == 0:
            if isLovely(i):
                lovely = i

else:
    for i in range(3, num + 1, 2):
        if num % i == 0:
            if isLovely(i):
                lovely = i
print(lovely)

import math

n = int(raw_input())
primeDivisors = []

if n % 2 == 0:
    n /= 2
    primeDivisors.append(2)
i = 3
if n == 6:
    primeDivisors.append(3)
    n /= 3
while i <= math.sqrt(n):
    if n % i == 0: primeDivisors.append(i)
    while n % i == 0:
        n = n / i
    i += 2
if n > 2: primeDivisors.append(n)
answer = 1
for x in primeDivisors:
    answer *= x
print answer

import math

n = input()

ans = 1
i = 2
while i < math.sqrt(n):
    if n % i == 0:
        ans *= i
        while n % i == 0:
            n /= i
    i += 1

if n > 1:
    ans *= n

print ans

import math

num = int(input())
lovely = 1

for i in range(2, int(math.sqrt(num)) + 1):
    if num % i == 0:
        lovely *= i
        num /= i
        while(num % i == 0):
            num /= i

if num > 1:
    lovely *= num

print(lovely)

#------------------------template--------------------------#
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()]

#-------------------------code---------------------------#
#vsInput()

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

print(ans)

from math import *
n = int(input())

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

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

N = int(raw_input())

mm = 1
##def isDivis(i,a):
##    for x in a:
##        if i%x==0:
##            return True
##        if x>i: break
##    return False

def isDivis(M):
    if math.sqrt(M)**2==M: return True
    for i in xrange(2,int(math.sqrt(M))+1):
        if M%i==0:
            if math.sqrt(i)**2==i: return True
            if math.sqrt(M/i)**2==M/i: return True
    return False
import math
if not isDivis(N):
    if mm<N: mm = N
else:
    for i in xrange(2,int(math.sqrt(N))+1):
        if N%i==0:
            if not isDivis(i):
                if mm<i: mm = i
            if not isDivis(N/i):
                if mm<N/i: mm = N/i
            if i<mm and N/i<mm:
                break

print mm

def lovenum(n):
 i=2;l=[]
 c=n
 while i*i<c:
  if n%i==0:
   n=n/i
   if i not in l:
    l.append(i)
  else:
   i+=1
  if n==1:
   break
 result=1
 for index in l:
  result*=index
 return result

print lovenum(int(raw_input()))

import math

n = int(raw_input())
primeDivisors = []

if n % 2 == 0:
    n /= 2
    primeDivisors.append(2)
i = 3
if n == 6: primeDivisors.append(3)
while i <= math.sqrt(n):
    if n % i == 0: primeDivisors.append(i)
    while n % i == 0:
        n = n / i
    i += 2
if n > 2: primeDivisors.append(n)
answer = 1
for x in primeDivisors:
    answer *= x
print answer

from sys import exit
from math import sqrt, floor, ceil

MAX_PRIME = int(sqrt(1e12))

n = int(input())
out = 1

sieve_last, sieve_b = 1, [True] * (MAX_PRIME + 1)
i = 2
while i <= int(sqrt(MAX_PRIME)):
    #print("!!!", i)
    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)
            #print(k)

        k += 1
    while k <= MAX_PRIME:
        sieve_b[k] = False
        k += i
        #print(k)
    i += 1
    while sieve_b[i] != True:
        i += 1

print(n * 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 ans
print(primefactor(int(input())))

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.ceil(math.sqrt(n)):
        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

from math import sqrt

def issquare(k):
	root = sqrt(k)

	if(root == int(root)):
		return 1
	else:
		return 0

def main():
	n = input()
	div = []

	ranges = range(1, n/2 + 1)
	ranges.sort(reverse = True)

	for i in ranges:
		if(n % i == 0 and (i not in div) and (n/i not in div)):
			if(i > 1):
				div.append(i)
			if(n/i > 1):
				div.append(n/i)
	div.sort(reverse = True)
	condition = 0

	for i in div:
		condition = 0
		reqd_range = range(2, i/2 + 1)

		if(i not in reqd_range):
			reqd_range.append(i)

		for j in reqd_range:
			if(i % j == 0):
				#print j, issquare(j)
				if(issquare(j)):
					condition = 1
					break

		if(condition == 0):
			print i
			break

main()

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:
        if a[0][1] % 2 != 0:
            return a[0][0] ** a[0][1]
        else:
            return a[0][0]
    return output

def get_simple_dels(curr):
    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(4)))

from math import sqrt
import sys
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)))
t=input()
z=list(factors(t))
z=sorted(z,reverse=True)
for i in range(len(z)-1):
    k=z[i]*z[i]
    for j in range(i+1,len(z)):
        if(k%z[j]==0):
            r=1
            print int(sqrt(k))
            sys.exit(0)

from math import sqrt

def factor(n):
    factors = set()
    for x in range(1, int(sqrt(n)+ 1)):
        if n % x == 0:
            factors.add(x)
            factors.add(n//x)
    return sorted(factors)

n = input()
if n == 1:
    print 0
    exit(0)

l = factor(n)[::-1]

#print l

for i in l:
    fl = 0
    for x in range(2, int(sqrt(n) + 1)):
        ans = i
        if i % (x*x) == 0:
            fl = 1
            break
    if fl == 0:
        break

print ans

import math
a=[]
for i in range(2,1000001):
	a.append(i*i)

def bsearch(n):
	l = 0
	h = len(a)
	while l<=h:
		m = (l+h)/2
		if a[m]>n:
			h = m-1
		elif a[m]<n:
			l = m+1
		else:
			return True
	return False

n = input()
s = int(math.sqrt(n)+1)

f = {}
for i in range(1,s):
	if n%i==0:
		f[i]=0
		f[n/i]=0

res = -1
for x in f:
	if f[x]==0 and bsearch(x):
		for y in f:
			if y%x == 0:
				f[y]=1
	elif f[x]==0:
		if x>res:
			res = x
print(res)

from math import sqrt,ceil
z=[1]*1000001;o=[]
for i in range(2,1000001):
    if z[i]==1:
        for j in range(i,1000001,i):z[j]=0
        o.append(i*i);z[i]=1
a=int(input());s=0
for i in range(1,ceil(sqrt(a))+1):
    if (i**0.5)%1:
        ok=1
        for j in o:
            if i%j==0:ok=0;break
            if i>j:break
        if ok:s=max(s,i)
    p = a // i
    ok = 1
    for j in o:
        if p % j == 0: ok = 0;break
        if p > j: break
    if ok:s=max(s,p)
print(s)

from math import sqrt

def is_lovely(n):
	for i in xrange(2, int(n**(1/2.0))+1):
		if n % (i*i) == 0:
			return False
	return True

n = int(raw_input())
for x in xrange(n, 1, -1):
	if n % x == 0 and is_lovely(x):
		print x
		break

n=int(input())
for i in range(2,n//2):
    if n%(i*i)==0:
        n/=i

print(int(n))

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

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, 2):
    if n % i == 0 and 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)
# 789554321

n=int(input())
k=int(n**0.5) + 1
a=[0]*(k)
b=[]
for i in range(2,k):
    for j in range(i,k,i):
        a[j]+=1
for i in range(1,k):
    if n%i==0:
        b.append(i)
        b.append(n//i)
b.sort(reverse=True)
for i in range(len(b)):
    for j in range(2,k):
        if a[j]==1 and b[i]%(j*j)==0:
            break
        elif j==k-1:
            exit(print(b[i]))

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)
    return l
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()

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(ans)

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

print(n)

#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import time
import sys
import io
import re
import math
import itertools
import collections
#sys.stdin=file('input.txt')
#sys.stdout=file('output.txt','w')
#10**9+7
mod=1000000007
#mod=1777777777
pi=3.141592653589
xy=[(1,0),(-1,0),(0,1),(0,-1)]
bs=[(-1,-1),(-1,1),(1,1),(1,-1)]
def gcd(a,b): return a if b==0 else gcd(b,a%b)
def lcm(a,b): return a*b/gcd(a,b)
#start = time.clock()
def calc_exp(n, p):
    e = 0
    while n % p == 0:
        e += 1
        n /= p
    return e, n

def gen_prime_candidates():
    yield 2
    n = 3
    while True:
        yield n
        n += 2

def factorize(n):
    f = ()
    for m in gen_prime_candidates():
        if m * m > n:
            break
        e, n = calc_exp(n, m)
        if e:
            f = f + ( (m, e), )
    if n != 1:
        f = f + ( (n, 1), )
    return f

def gen_divisors(f, k = 0):
    if k == len(f):
        yield 1
    else:
        p, e = f[k]
        for d in gen_divisors(f, k + 1):
            for e1 in range(e + 1):
                yield p ** e1 * d

n=int(raw_input())
f = factorize(n)
l=[]
tmp=[]
for d in gen_divisors(f):
    l.append(d)
l.sort()
t=len(l)
for i,j in enumerate(l):
    if j>1:
        if l[-1]%(j**2)==0:
            l.pop(-1)
print l[-1]

from math import sqrt as sq
n=input()
g=n
s=int(sq(n))+1
if s%2==0:
    p=s-1
else:
    p=s
i=3
res=1
while i*i<=g:
    c=0
    k=n
    while n%i==0:
        n/=i
        c+=1
    if c>0 and c%2==0:
        res=max(res,k/i)
    n=k
    i+=2
c=0
k=n
while n%2==0:
    n/=2
    c+=1
if c>0 and c%2==0:
    res=max(res,k/2)
else:
    res=max(res,k)
print res

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

if ans==1:
    print(n)
else:
    print(ans)

t=input()
primes=[1]*((10**6)+5)

for i in xrange(2,(10**6)+1):
    if primes[i]==1:
        j=2
        x=i*j
        while x<(10**6)+1:
            primes[x]=0
            j+=1
            x=i*j

def fun(t):

 for i in xrange(2,int(math.sqrt(t))+1):
    if t%i==0:
        return False

 return True

import math
ans=1
for i in xrange(2,int(math.sqrt(t))+1):
    if primes[i]:
        if t%i==0:
            ans*=i

            if fun(t/i) and (i*i)!=t:
                ans*=(t/i)

            if ans==t:
                break

if fun(t):
    ans=t

print ans

a=[0]*1001
b=[]
for i in range(2,1000):
    for j in range(i,1000,i):
        a[j]+=1
n=int(input())
for i in range(1,int(n**0.5) + 1):
    if n%i==0:
        b.append(i)
        b.append(n//i)
b.sort(reverse=True)
#print(b)
for i in range(len(b)):
    for j in range(2,1001):
        if a[j]==1 and b[i]%(j*j)==0:
            #print(j,end='  ')
            break
        elif j==1000:
            exit(print(b[i]))

import math
from fractions import gcd

# retorna se é divisível por algum quadrado perfeito
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

p = []
primos = [True for i in range(raiz)]
primos[1] = False
for i in range(2, raiz):
    if primos[i]:
        p.append(i)
        for j in range(i*i, raiz, i):
            primos[j] = False

eh_divisivel = True
i = n
anterior = n
while eh_divisivel:
    eh_divisivel = divisible(i)

    if eh_divisivel:
        j = 0
        while p[j] <= int(math.sqrt(i)):
            if i % p[j] == 0:
                i //= p[j]
                break
            j += 1
        if j == int(math.sqrt(i)):
            i -= 1

if not eh_divisivel:
    print(i)

#for i in range(n, 0, -1):
#    if n % i != 0:
#        continue
#    eh_divisivel = divisible(i)
#
#    print(i, eh_divisivel)
#
#    if not eh_divisivel:
#        print(i)
#        break

###################################
## Eric Breno B. - UFCG - BRAZIL ##
###################################

n = int(raw_input())

saida = []

def testa(n):
	if n < 4: return True
	if n == 4: return False
	if n < 8: return True

	for i in xrange(2, int(n**0.5 + 1)):
		if n % i == 0:
			if ((n/i)**0.5)%1 == 0 or ((i)**0.5)%1 == 0:
				return False
	return True

def t(n):
	md = 1
	testar = True
	foi = False

	for i in xrange(2, int(n**0.5 + 1)):
		if n % i == 0:
			if testar and testa(n/i):
				md = n/i
				testar = False

			elif testar and testa(i):
				if i > md: md = i

			if (i**0.5)%1==0 or ((n/i)**0.5)%1==0: foi=True

	if foi:return t(md)
	else: return n

print t(n)

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():
    temp = i - (1 if i % 2 == 0 else 0)
    for p in range(temp):
        ans = ans * k
print(ans)

import math
n = int(input())

ans = 1
upper = int(math.sqrt(n))
for i in range(2, upper):
    if n % i == 0:
        ans *= i
        while n % i == 0:
            n /= i

ans *= n
print(int(ans))

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)

#!/usr/bin/env python3

n = int(input())

square = [i ** 2 for i in range(2, int(n**0.5))]

def is_valid(k):
    for x in square:
        if x < k and k % x == 0:
            return False
    return True

for i in range(n, 0, -1):
    if n % i == 0 and is_valid(i):
        print(i)
        break

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<y:
        for i in p:
            if t%i==0:
                break
            if i*i>t:
                if y%t==0:
                    y=y//t
                    d=d*t
                    while y%t==0:
                        y=y//t
                break
        t+=2
    return d*y

n=int(input())
print(rez(n))

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
for i in range(p+1):
    if(A[p]%(A[i]*A[i])==0):
        p-=1
print(A[p])

'''input
817634153013
'''
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

# main starts
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
#print(factors[:11])
ans = 1
for i in range(2, len(factors)):
	if factors[i] != 0:
		ans *= i
if flag == 0:
	print(ans)
else:
	print(cn)

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

def multiply(a):
    output = 1
    for item in a:
        output = output * item
    return output

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

n = int(input())
print(multiply(get_simple_dels(n)))

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
print(ans)

import math

orig = n = int(input().strip())

ans = 1
if n % 2 == 0:
	ans *= 2
	n //= 2
	while n % 2 == 0:
		n //= 2

for it in range(3, orig // 2 + 1, 2):

	if n % it == 0:
		ans *= it
		n //= it
		while n % it == 0:
			n //= it

print(ans)

import math

num = int(input())
lovely = 1

for i in range(2, int(math.sqrt(num)) + 1):
    if num % i == 0:
        lovely *= i
        num /= i
        while(num % i == 0):
            num /= i

if num > 1:
    lovely *= num

print(lovely)

from math import sqrt

def factor(n):
    factors = set()
    for x in range(1, int(sqrt(n)+ 1)):
        if n % x == 0:
            factors.add(x)
            factors.add(n//x)
    return sorted(factors)

n = input()
if n == 1:
    print 1
    exit(0)
if n == 2:
    print 2
    exit(0)
if n == 3:
    print 3
    exit(0)

l = factor(n)[::-1]

#print l

for i in l:
    fl = 0
    for x in range(2, int(sqrt(i) + 1)):
        ans = i
        if i % (x*x) == 0:
            fl = 1
            break
    if fl == 0:
        break

print ans
exit(0)

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:
        if a[0][1] % 2 != 0:
            return a[0][0] * a[0][1]
        else:
            return 1
    return output

def get_simple_dels(curr):
    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)))

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)

import math,sys,time
def calc(n):
    i=2
    s=set()
    m = math.sqrt(n)
    while n!=1 and i<=m:
        if n%i==0:
            n=n/i
            s.add(i)
        else:
            i=i+1
    if len(s)==0:
        return n
    else:
        ans = 1
        for number in s:
            ans = ans * number
        return ans

if __name__=='__main__':
    n = raw_input()
    #t=time.time()
    #n = 4
    print calc(int(n))
    #print time.time()-t

def tem_divisor_quadrado(numero,lista):
	i = 0
	while numero >= lista[i] :
		if numero % lista[i] == 0 :
			return True
		if i == len(lista):
			break
		i += 1
	return False

num = int(raw_input())

if num % 10 == 0:
	print 10
else:
	cont = 1
	x = 0
	lista = []
	while x < num :
		cont += 1
		x = cont ** 2
		lista.append(x)
	for j in xrange(num  ,2,-1):
		if num % j == 0 and not tem_divisor_quadrado(j,lista):
			print j
			break

#!/usr/bin/env python3

n = int(input())

square = [i ** 2 for i in range(2, int(n**0.5))]

def is_valid(k):
    for x in square:
        if x <= k and k % x == 0:
            return False
    return True

for i in range(n, 0, -1):
    if n % i == 0 and is_valid(i):
        print(i)
        break

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):
    if n%i==0:
        a.append(n)
if n>2:
    a.append(n)
l=1
a = list(set(a))
for i in a:
    l*=i
print(l)

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

n = int(input())
if is_prime(n):
    print(n)
    sys.exit(0)
div = set()

if n % 2 == 0:
    div.add(2)
k = int(math.sqrt(n))
for i in range(3, k + 1, 2):
    if n % i == 0 and 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)
# 789554321

#In the name of Allah

from sys import stdin, stdout
input = stdin.readline

n = int(input())

for i in range(2, 10 ** 6 + 1):
        if n % (i * i) == 0:
                n /= i * i

stdout.write(str(n))

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author  : Napoleon
# @Mail    : tyfdream@163.com
# @Data    : 2015-07-22 11:40:35
# @Version : python 2.7
import math
n = int(raw_input())
ans = 1
s = 2
a = n
while s*s < a :
    while n %(s*s) == 0:
        n/=s
    s += 1

print n

from math import sqrt
def FindAllDivisors(x):
    divList = []
    y = 1
    sqrx = sqrt(x)
    while y <= sqrx:
        if x % y == 0:
            divList.append(y)
            divList.append(int(x / y))
        y += 1
    return sorted(divList)

n = int(raw_input())
while 1:
    a = FindAllDivisors(n)
    found = False
    for i in range(1, len(a) - 1):
        if int(sqrt(a[i])) ** 2 == a[i]:
            n = a[-2]
            found = True
            break
    if found:
        continue
    else:
        break
print n

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

__author__ = 'trunghieu11'

def solve(n):
    answer = 1
    i = 2
    while i**2 < n:
        if i**2 > n:
            break
        if n % i == 0:
            answer *= i
            while n % i == 0:
                n /= i
        i += 1
    if n > 1:
        answer *= n
    return answer

if __name__ == '__main__':
    n = int(raw_input())
    print solve(n)

def isLovely( x ) :
    a = 2
    a2 = a**2
    while a2 <= x :
        if x % a2 == 0 :
            return False
        a += 1
        a2 = a**2
    return True

n = int(input())
k = 2
con = True
ans = 1
while n > 1 :
    if con and isLovely( n ) :
        ans = n
        break

    con = True

    if n % k == 0 :
        n //= k
    else :
        k += 1
        con = False

print( ans )