import scala.io.StdIn.readLine
import scala.unchecked

object Main extends App {
  val n = readLine.toInt
  val s = readLine.toArray

  println(0 max solve(0, s))

  def solve(x: Int, s: Array[Char]): Int = {
    if (s.isEmpty) x
    else {
      val newx = x + ((s.head: @unchecked) match {
        case 'I' =>  1
        case 'D' => -1
      })
      newx max solve(newx, s.tail)
    }
  }
}
