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

int main(){
long long int N;
cin>>N;
long long int ans=0;
for(long long int k=1;k<N;k++){
if(k*k+k >= N) break;
if(N%k != 0)continue;
ans += N/k-1;
}
cout << ans << endl;
}