import java.util.*; import java.io.*; import java.math.*; // import java.util.stream.Stream; class Main{ static BufferedReader buff = new BufferedReader(new InputStreamReader(System.in)); static StringTokenizer st; static PrintWriter output = new PrintWriter(System.out); static Scanner sc = new Scanner(System.in); public static void main(String[] args) throws IOException{ long n = sc.nextLong(); Map m = prime_factorization(n); long ans = 0; for(long val : m.keySet()) ans += val*m.get(val); output.print(ans); output.flush(); } static Map prime_factorization(long val) { Map map = new HashMap<>(); for(long i=2; i*i<=val;i++) { int count = 0; while(val % i == 0) { val /= i; count++; } if(count > 0)map.put(i,count); } if(val != 1L) map.put(val,1); return map; } }