import Data.List (scanl')

computeMax :: String -> Int
computeMax = maximum . scanl' f 0
    where
        f x 'I' = x + 1
        f x 'D' = x - 1
        f x _ = x

main :: IO ()
main = do
    _ <- getLine
    s <- getLine
    print $ computeMax s
