#include <bits/stdc++.h>

int main()
{
	long long N;
	scanf("%lld", &N);
	long long count{};
	for (long long q{1}; q * (q + 2) <= N; q++)
	{
		if (N % q) continue;
		if (N / q - 1 <= q) break;
		count += N / q - 1;
	}
	printf("%lld\n", count);

	return 0;
}