require 'prime' p gets.to_i.prime_division.map{|q,r|(0..r).reduce(0){|s,e|s+q**e}}.reduce :*