#include<iostream>
#include<cmath>

typedef long long ll;

using namespace std;

int main()
{ll N; cin >> N;
 ll c = (ll) sqrt((double) (N + 1)) - 1 ;
 
 ll total = 0;
 
 for(ll s = 1; s <= c; s++)
 {if( N % s == 0){total += N/s - 1;}}
 
  cout << total << endl;
 
 return 0;
}