require 'prime' n = gets.to_i m = 0 count = 0 prime_array = Prime.prime_division(n) prime_array.each do |array| (count + 1).upto(count + array[1]) do |i| m += (array[0] - 1) * ((i - 1) / 3 + 1) p ((i - 1) / 3 + 1) end count += array[1] end print m print ' ' puts n - 1