import math def f(m, n): def f1(i,r): while i>2: if n%i==0: r=i i=i-1 return r f2 = lambda i: i//2 if i!=4 and n%2==0 else i r = f1(m,0) return f2(n) if r==0 else r g = lambda n: math.floor(math.sqrt(n)) h = lambda n: f(g(n),n) print(h(int(input())))