#include "bits/stdc++.h"
using namespace std;
using ll=long long;
int main(){
	ll n;cin>>n;
	ll ans=0;
	for(ll i=1;i*i<=n;i++){
		if(n%i!=0)continue;
		ll t=n/i; t--;
		if(i<t)ans+=t;
	}
	cout<<ans<<endl;
}