let n = read_int ()
let m = int_of_float (sqrt (float_of_int n)) + 2

let rec f i n ans =
  if i = m then max ans 1
  else
    let rec g j n =
      if n mod i = 0 then g (j + 1) (n / i)
      else j, n in
    let j, n = g 0 n in
    let k = float_of_int (1 + 8 * j) in
    let k = int_of_float ((-1. +. sqrt k) /. 2.) in
    f (i + 1) n (ans + k)

let  () = Printf.printf "%d\n" (if n = 1 then 0 else f 2 n 0)
