let () = Scanf.scanf "%d\n" @@ fun n ->
    let rec exec e n p =
        if (n mod p) == 0 then exec (e + 1) (n / p) p
        else
            let rec get_val i =
                if i * (i + 1) / 2 <= e then get_val (i + 1)
                else i - 1
            in get_val 0
    in let sqrtn = (int_of_float @@ sqrt @@ float_of_int n) + 1
    in let is_primes = Array.init (sqrtn + 1) @@ fun n -> (n, true)
    in let sieve (i, is_prime) =
        if i >= 2 && is_prime
        then
            let rec multiple_to_false j =
                if i * j <= sqrtn then (
                    Array.set is_primes (i * j) (i * j, false);
                    multiple_to_false @@ j + 1
                )
            in multiple_to_false 2
    in ignore @@ Array.map sieve is_primes;
    Printf.printf "%d\n" @@ Array.fold_left (+) 0 @@
        Array.map (fun (i, is_prime) -> if i >= 2 && is_prime then exec 0 n i else 0) is_primes

