#include <cstdio>
using namespace std;
int main(void)
{
unsigned long long int a;
while(scanf("%u",&a)!=EOF){
unsigned long long int i = 2,sum = 0;
while (i <= a)
{
while (a % i == 0)
{
sum+=i;
a /= i;
}
if(i==2)
i++;
else
i+=2;
}
printf("%u\n",sum);
}
}