n,k = map(int,raw_input().split()) for i in range(1,n): if(n%i==0): ans = i; print ans