#include<bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
using ll = long long;
ll n, ans;
int main(){
	scanf("%lld", &n);
	for(ll i = 1; i*(i+1) < n; i++){
		if(n%i == 0) ans += n/i-1;
	}
	printf("%lld\n", ans);
}