Problem:
Score : 400 points

Problem Statement

Given is a positive integer N. Consider repeatedly applying the operation below on N:

First, choose a positive integer z satisfying all of the conditions below:

z can be represented as z=p^e, where p is a prime number and e is a positive integer;

z divides N;

z is different from all integers chosen in previous operations.

Then, replace N with N/z.

Find the maximum number of times the operation can be applied.

Constraints

All values in input are integers.

1 \leq N \leq 10^{12}

Input

Input is given from Standard Input in the following format:

N

Output

Print the maximum number of times the operation can be applied.

Sample Input 1

24

Sample Output 1

3

We can apply the operation three times by, for example, making the following choices:

Choose z=2 (=2^1). (Now we have N=12.)

Choose z=3 (=3^1). (Now we have N=4.)

Choose z=4 (=2^2). (Now we have N=1.)

Sample Input 2

1

Sample Output 2

0

We cannot apply the operation at all.

Sample Input 3

64

Sample Output 3

3

We can apply the operation three times by, for example, making the following choices:

Choose z=2 (=2^1). (Now we have N=32.)

Choose z=4 (=2^2). (Now we have N=8.)

Choose z=8 (=2^3). (Now we have N=1.)

Sample Input 4

1000000007

Sample Output 4

1

We can apply the operation once by, for example, making the following choice:

z=1000000007 (=1000000007^1). (Now we have N=1.)

Sample Input 5

997764507000

Sample Output 5

7

Solution in Haskell (GHC 8.8.3) (judge verdict: Wrong Answer)

{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE TypeFamilies #-}
import           Data.Maybe
import           Data.Int
import           Data.List
import           Data.Char
-- import qualified Data.Vector.Unboxing as VU
import qualified Data.Vector as V
import qualified Data.Vector.Mutable as VM
import qualified Data.Vector.Unboxed as VU
import qualified Data.Vector.Unboxed.Mutable as VUM
import qualified Data.ByteString.Char8 as BS
import           Data.List (scanl')
import           Data.IORef
import           Control.Monad
import           Control.Monad.ST
import           Control.Monad.State.Strict
import           Control.Monad.Primitive
import           Control.Applicative
import           Debug.Trace
import           Text.Printf

main = do
  n <- getInt
  print 1

readInt = BS.readInt . BS.dropWhile isSpace
getVector f = VU.unfoldr f <$> BS.getLine
getIntVector = getVector readInt
getBSVector = getVector BS.uncons
getInt = readLn :: IO Int
getInt2Tuple = (\vec -> (vec VU.! 0, vec VU.! 1)) <$> getIntVector
getInt3Tuple = (\vec -> (vec VU.! 0, vec VU.! 1, vec VU.! 2)) <$> getIntVector

divisor n = loop 1
  where
    loop d
      | n < d^2 = []
      | n == d^2 = [d]
      | otherwise = if r == 0 then d : q : loop (d+1) else loop (d+1)
      where (q,r) = n `divMod` d

solve n = if length nDivisor == 1 then 1 else loop n nDivisor' 0
  where
    primeTable = sieve n
    nDivisor = tail $ divisor n
    nDivisor' = sort $ filter factoring nDivisor
    loop _ [] count = count
    loop n (x:xs) count
      | r == 0 = loop q xs $ count + 1
      | otherwise = count
        where
          (q,r) = n `divMod` x




type PrimeTable = VU.Vector Bool

primeTableToList :: PrimeTable -> [Int]
primeTableToList t = [i | i <- [0..VU.length t-1], t VU.! i]

isInPrimeTable :: PrimeTable -> Int -> Bool
isInPrimeTable t n
  | 0 <= n && n < VU.length t = t VU.! n
  | otherwise = error "out of range"


sieve :: Int -> PrimeTable
sieve n = VU.create $ do
  vec <- VUM.replicate (n+1) True
  VUM.write vec 0 False
  VUM.write vec 1 False
  forM_ [2..n] $ \i -> do
    b <- VUM.read vec i
    when b $ do
      forM_ [2*i,3*i..n] $ \j -> do
        VUM.write vec j False
  return vec

factoring 1 = False
factoring n = loop primetable []
  where
    primetable =  primeTableToList $ sieve n
    loop (p:ps) []
      | n `mod` p == 0 = loop ps [p]
      | otherwise = loop ps []
    loop [] x = True
    loop (p:ps) x
      | n `mod` p == 0 = False
      | otherwise = loop ps x