require 'prime' n = gets.to_i p = n.prime_division.map{|p,v| [p]*v }.flatten.reverse d = p[0..2] p[3..-1]&.each do |v| d[0] *= v d.sort! end t_min = d.inject(0){|m,i| m + (i - 1)} puts "#{t_min} #{n - 1}"