n,k=map(int,input().split()) import math d={} maxi=0 for i in range(2,math.floor(n**0.5)+1): if n%i==0: cnt=0 nq=n while nq%i==0: nq//=i cnt+=1 d[cnt]=i maxi=max(maxi,cnt) ans=d[maxi] #print(ans,n) print(n//ans)