fun main(args: Array<String>) = shojin06e()

fun shojin06e() {
    val n = readLine()!!.toLong()

    if (n == 1L) return println(0)

    var answer = 0L

    for (i in 1..Math.sqrt(n.toDouble()).toLong()) {
        val m = (n - i) / i
        if (n / m == n % m) answer += m
    }

    println(answer)
}
