# -*- coding: utf-8 -*- X = int(input()) # Xを素因数分解する primes = {} for i in range(2,1000001,1): while X>=i and X%i==0: X //= i if i in primes: primes[i] += 1 else: primes[i] = 1 Y = 1 if len(primes) == 0: Y = X else: for key in primes: if primes[key]%2 == 1: Y *= key print(Y)