N,K = map(int,input().split()) import sys for i in range(2,N + 1): if N % i == 0: if i == N: print(1) exit() else: print(N // i) exit()