import java.util.Scanner;


public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        //本质上就是求质因数分解,如果没有质因数则为质数
        int n = in.nextInt();
        int res =0;
        boolean isPrime = true;
        int i = 2;
        while(n!=0){
            if( i > n){
                break;
            }
            while( n%i == 0){
                res +=i;
                n /= i;
            }
            i++;
        }
        if(res == 0){
            System.out.println(n);
        }
        else
            System.out.println(res);

      
    }
}