n = gets.to_i
# n = 1145148931919
d = n.even? ? n/2 : n

sum = 0
1.upto(Math.sqrt(d).floor) do |a|
  if d % a == 0
    sum += a
    sum += d/a unless d == a*a
  end
end
p sum