//written by NewbieChd
#include <iostream>
using namespace std;

int main() {
    unsigned long long n, i, ans = 0;
    cin >> n;
    for (i = 1; i * i < n; ++i)
        if (n % i == 0 && i < n / i - 1)
            ans += n / i - 1;
    cout << ans;
    return 0;
}
