#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
  ll n;
  cin >> n;
  ll ans = 0;
  for(int i = 1;i < pow(n,0.5000);i++){
    if((n-i)%i == 0){
        if((n-i)/i > i)ans += (n-i)/i;
    }
  }
  cout << ans << endl;
  cin >> n;
}