n = gets.to_i m = Math.sqrt(n) ans = 0 1.upto(m) { |i| ans += i + n / i if n % i == 0 } ans -= m.to_i if m == m.to_i puts ans