#include<bits/stdc++.h>
using namespace std;
using ll=long long;

int main(){
  int i,j,k,cnt=0;
  ll n;
  cin>>n;
  ll p=(ll)round(sqrt(n));
  ll sum=0;
  for(i=1;i<p;i++){
    if(n%i==0)sum+=n/i-1;
  }
  cout<<sum;
}
