import Data.ByteString.Char8 as BS

main :: IO ()
main = do
  n <- readLn :: IO Int
  s <- BS.getLine :: IO BS.ByteString
  print $ calc s n

calc :: BS.ByteString -> Int -> Int
calc s n
  | s == mempty = n 
  | BS.head s == 'I' = calc (BS.tail s) (max n n+1) 
  | otherwise        = calc (BS.tail s) (max n n-1) 
  
