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