require 'prime'
n = gets.to_i
a = n.prime_division.map{|m|(m[1]+1).times.map{|mt| m[0]**mt}}.inject([1]){|s,i| s = s.flat_map{|sm| i.map{|im| im * sm }}}.sort
p a[(a.size+1)/2..-1].map{|m|m-1}.inject(:+)
