import Data.List

main :: IO()
main = do
    getLine
    str <- getLine
    print $ getsolve 0 0 str


getsolve :: Int -> Int -> String -> Int
getsolve num _ [] = num
getsolve num now ('I':strs) = getsolve (max num (now + 1)) (now + 1) strs
getsolve num now ('D':strs) = getsolve num (now - 1) strs
