#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long ll;
ll n,i,ans=0;
int main()
{
	scanf("%lld",&n);
	for(i=1;i*i<=n;i++)
	{
		if(n%i==0&&i<n/i-1)ans+=n/i-1; 
	}
	printf("%lld\n",ans);
	return 0;
}