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