import java.util.Scanner; public class Main { public static void main(String[] args) { try (Scanner sc = new Scanner(System.in)) { int N = sc.nextInt(); int sum = 0; for (int i = 2;i <= N;++ i) { while(N % i == 0) { sum += i; N /= i; } } System.out.println(sum); } } }