import math n,k = map(int,raw_input().split()) a = [i for i in range(2,n+1)] p = [] while a: if a[0] <= math.sqrt(a[-1]): p.append(a[0]) a = filter(lambda x:x%a[0]!=0, a) else: p += a break b=[2,1] if n not in p: for i in p: if n%i == 0: s = n/i b = [i,s] break print b[1]