def solver_sub():
    global N, K
    for i in range(3,N//2+1,2):
        if N % i == 0:
            return N//i
    return 1

N, K = map(int, input().split(" "))

if N % 2 == 0:
    print(N//2)
else:
    print(solver_sub())