require 'prime' n,k = gets.split.map(&:to_i) a = Prime.prime_division(n)[0][0] p n / a