import Data.List

main = interact $ show . sol . read

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

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

pf 1 = []
pf 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 

primes = sm++lg
  where
  1:p:cs  = roll $ foldl g (1,[1]) sm
  sm      = [2,3,5,7]
  lg      = p:filter pr cs
  pr n    = all ((>0) . (n `mod`)) $ takeWhile (\p -> p*p <= n) lg

roll (n,rs) = [n*k+r | k <- [0..], r <- rs]

g (n,rs) p = (p*n,[r2 | k <- [0..(p-1)], r <- rs, let r2 = n*k+r, r2 `mod` p>0])
