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()

m = 0
x = 0
for i in s:
  if s=='I':
    x = x + 1
  elif s=='D':
    x = x - 1
  m = max(m ,x)
  
print(m)
_=input()
s = input()
 
m = 0
x = 0
for i in s:
  if i=='I':
    x = x + 1
  elif i=='D':
    x = x - 1
  m = max(m ,x)
  
print(m)