#include <iostream>
#include <string>
#include <map>
#include <math.h>
using namespace std;

#define ll long long

int main(){
    ll N,ans = 0;
    cin >> N;
    for(ll i = 1;i < N/i - 1;i++){
        if(N%i == 0)ans += N/i - 1;
    }
    cout << ans << endl;
    return 0;
}