x = gets.to_i xn = x n = 2 z = Array.new while true do if xn % n != 0 n += 1 next end while xn % n == 0 do xn /= n end a = x / n b = n while true do r = a % b if r == 0 break end a = b b = r end w = x / b z.push((w / (x / n)) * (w / n)) if xn == 1 break; end end print z.min