from math import isqrt N, K = map(int, input().split()) i = 2 Nsq = isqrt(N) while i <= Nsq: if N % i: i += 1 else: print(N // i) exit() print(1)