fun main(args: Array<String>){
    val n = readLine()!!.toLong()
    val rn = Math.sqrt(n.toDouble()).toLong()

    val ans = (1..rn).filter { n%it==0L }.map { n/it-1 }.filter { it>rn }.sum()
    println(ans)
}