main :: IO()
main = do
    n <- readLn
    print $ getsolve n
    
getsolve :: Int -> Int
getsolve n
    | n == 0		= 0
    | n < 10		= 1 + getsolve (n-1)
    | n < 100		= getsolve (n - 1)
    | n < 1000		= 1 + getsolve (n-1)
    | n < 10000		= getsolve (n-1)
    | n < 100000	= 1 + getsolve (n-1)
    | otherwise		= getsolve (n-1)