# -*- coding: utf-8 -*- import fractions def factor(n, rho): f=lambda a:(a*a+rho)%n x=2 y=2 d=1 while d is 1: x=f(x) y=f(f(y)) d=fractions.gcd(abs(x-y), n) # print("n=%d rho=%d: x=%d y=%d d=%d"%(n,rho,x,y,d)) return d def add_factor(n, lst): if (n%2)==0: d=2 else: d=factor(n,n-1) lst.append(d) return int(n/d), lst def factorint(n): """ Using Prllard's rho algorithm with Linier congruential generators. """ lst=[] while n is not 1: n, lst = add_factor(n, lst) return lst def main(): X=int(input()) factors=factorint(X) factors.sort() Y=1 prev=1 for index in range(len(factors)): # print("%d, %d"%(prev, factors[index])) if factors[index] == prev: prev=1 else: Y=Y*prev # print(" *%d=%d"%(prev, Y)) prev=factors[index] Y=Y*prev print(Y) if __name__ == '__main__': main()