#include<iostream>
#include<cmath>
using namespace std;
int main()
{
  long long n,k,i,j,res=0;
  cin >> n;
  k=(long long)sqrt(n);
  for(i=1;i<=k;i++){
    if(n%i!=0) continue;
    j=n/i-1;
    if(j>i) res+=j;
  }
  cout << res << endl;
  return 0;
}