#include<iostream>
#include<cmath>
using namespace std;
typedef long long ll;

int main(void){
  ll n; cin>>n;
  ll ret=0;
  for(ll i=1; i<sqrt(n); ++i){
    if( n % i == 0 && (n/i-1) != i ){
      ret += (n/i)-1;
    }
  }
  cout<< ret <<endl;

  return 0;
}