import kotlin.math.round
import kotlin.math.sqrt

fun main() {
    val n = readLine()?.toLong() ?: return
    var t = 0L
    1.until(round(sqrt(n.toDouble())).toInt()).forEach {
        if (n % it == 0L) {
            t += n / it - 1
        }
    }
    println(t.toString())
}
