N,K=map(int,input().split()) for i in range(K,N+1): if N%i==0: print(N//i) break