#include <fstream>

using namespace std;
ifstream f1("TONGUOC.INP");
    ofstream f2("TONGUOC.OUT");
int f[100000];
int main()
{int n,i,j;
long long tong=0;
f1>>n;
for (i=1;i*i<=n;i++)
{ if (n%i==0)
   {   j=n/i;
       if (j!=i)
       tong=tong+i+j;
       else tong=tong+i;}

}
f2<<tong;
}
