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