import qualified Data.ByteString.Char8 as BS
import Data.List as L
import Data.Maybe 
import Data.IntMap as M

readInt = fst . fromJust . BS.readInteger

getInt = readInt <$> BS.getLine

primes :: Integral a => [a]
primes = L.map fromIntegral ([2, 3] ++ primes' :: [Int])
  where
    primes' = 5 : sieve [] primes' 7
    sieve divs (x : xs) n = ps ++ sieve (divs ++ [x]) xs (x * x)
      where
        isPrime m = and [rem m x /= 0 | x <- divs]
        ns = [y + z | y <- [n, n + 6 .. x * x - 2], z <- [0, 4]]
        ps = L.filter isPrime ns

fac :: [Integer] -> M.IntMap Integer -> Integer -> M.IntMap Integer
fac _ m 1 = m
fac [] m n = M.insert (fromIntegral n) 1 m
fac pa@(p : pr) m n
  | mod n (fromIntegral p) == 0 = fac pa (M.insertWith (+) (fromIntegral p) 1 m) (div n (fromIntegral p))
  | otherwise = fac pr m n

checkParts :: Int -> Int -> Int
checkParts t n
  | t >= n = 1 + checkParts (t - n) (n + 1)
  | otherwise = 0

calc :: [Int] -> Int
calc [] = 0
calc (t:ts) = length (takeWhile (<= t) [i*(i+1) `div` 2 | i<-[1..]]) + calc ts

main = do
  n <- getInt
  if n == 1
    then print 0
    else do
      let factors = fac primes M.empty n
      print $ calc (L.map fromIntegral (M.elems factors))
