"use strict";
function I(t,i){this._s=t.split("\n"),this._c=0,this._l=0,this._f=i||Number}I.prototype.a=function(t){var i=this._s[this._l];if(i){var s=i.trim().split(" "),h=s[this._c];return this._c++,s.length===this._c&&(this._c=0,this._l++),t?t(h):this._f(h)}},I.prototype.l=function(t){var i=this._s[this._l];if(i)return this._c=0,this._l++,i.split(" ").map(t||this._f)},module.exports=I;

function main(input) {
  var o = new I(input);

  var n = o.a();

  var m = Math.sqrt(n);

  var half = [];
  for (var i = 1; i <= m; i++) {
    if (n % i === 0) {
      half.push(i);
    }
  }

  var div = [];
  half.forEach(x => {
    div.push(x);
    if (x !== n / x) div.push(n / x);
  });
  div.sort((a,b) => a - b);

  var sum = 0;
  div.forEach(a => {
    var x = n / a - 1;
    if ( x > a ) {
      sum += x;
    }
  });

  console.log(sum);
}


main(require("fs").readFileSync("/dev/stdin", "utf8"));
