import std;
void main(){
	auto n=readln.chomp.to!long;
	auto r=0;
	for(auto d=2;d<=n;d++){
		while(n%d==0){
			n/=d;
			r+=d;
		}
	}
	writeln(r);
}