let ($) f g = fun x -> g (f x)
let n = Scanf.sscanf (read_line ()) "%d" @@ fun n -> n

let rec prime_fact acc i n =
  if n = 0 then acc
  else if n < i * i then n :: acc
  else if n mod i = 0 then prime_fact (i :: acc) i (n / i)
  else prime_fact acc (i + 1) n

let prime_fact n =
  List.fold_left (fun acc i ->
    match acc with
      | [] -> [(i, 1)]
      | (v, cnt) :: xs -> if v = i then (v, cnt + 1) :: xs else (i, 1) :: (v, cnt) :: xs
  ) [] @@ prime_fact [] 2 n

let () =
  if n = 1 then print_endline "0"
  else begin
    let acc = prime_fact n in
    let (ans, _) = List.fold_left (fun (sum, rest) (v, cnt) ->
      let t_sum = ref sum in
      let t_rest = ref rest in
      let tv = ref v in
      for i = 1 to cnt do
        if !t_rest >= !tv && !t_rest mod !tv = 0 then begin
            (* Printf.printf "%d %d %d\n" !t_sum !t_rest !tv; *)
            t_sum := !t_sum + 1;
            t_rest := !t_rest / !tv;
            tv := !tv * v
        end
      done;
      (!t_sum, !t_rest)
    ) (0, n) acc in
    Printf.printf "%d\n" ans
  end