import Data.List

main = interact $ show . sol . read

sol :: Int -> Int
sol = sum . map (f . length) . group . primeFactors

f n = truncate $ sqrt (2*fromIntegral n+0.25)-0.5

primes = 2:filter ((==1) . length . primeFactors) [3,5..]

primeFactors 1 = []
primeFactors n = factor n primes

factor n (p:ps) 
  | p*p > n      = [n]
  | n `mod` p==0 = p:factor (n `div` p) (p:ps)
  | otherwise    = factor n ps