x = int(input()) for i in range(2,x): i *= i if x < i: break while x%i==0: x //= i print(x)