#include<iostream>
#include<string>
using namespace std;




int main(){
	long long N;
  	cin >> N;
  	long long sum = 0;

	for(long long r = 1 ; r < 1000000;r++){
		if((N-r)/r>r&&(N-r)%r==0)sum += (N-r)/r;
    
    }
  	cout << sum <<endl;
}
