N, K = gets.split.map(&:to_i) ans = N / (2..N).find {|i| N % i == 0} puts ans