#include<bits/stdc++.h>
using namespace std;
int main() 
{
	ifstream f1("tonguoc.inp");
	ofstream f2("tonguoc.out");
	unsigned long long n;
	unsigned long long m=0;	
	f1>>n;
	for (unsigned long long i=1;i<=sqrt(n);i++) 
	{
		if (n%i==0) 
		{
			unsigned long long j=n/i;
			if (i==j) 
			{
				m=m+i;
			} 
			else 
			{
				m=m+i+j;
			}
		}
	}
	f2<<m;
	f1.close();
	f2.close();	
}
