# -*- coding: utf-8 -*- N,K = map(int, input().split()) i = 2 max_div = 1 while i*i<=N: if N%i==0: max_div = N // i break i += 1 print(max_div)