require 'prime' X = gets.to_i divs = Prime.prime_division(X) ans = 1 divs.each do |item| if item[1] % 2 == 1 then ans *= item[0] end end p ans