You have an integer variable x. Initially, x=0.  Some person gave you a string S of length N, and using the string you performed the following operation N times. In the i-th operation, you incremented the value of x by 1 if S_i=`I`, and decremented the value of x by 1 if S_i=`D`.  Find the maximum value taken by x during the operations (including before the first operation, and after the last operation).
_ = input()
s = input()

print(max((s.count('I') - s.count('D')), 0))
_ = input()
S = input()
max_n = 0
temp = 0

for s in S:
  if s == 'I':
    temp += 1 
  else:
    temp -= 1
  
  if max_n < temp:
    max_n = temp
    
print(max_n)