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()
n=input()
a=c=0
for i in n:
  if i=='I':a+=1
  else:a-=1
  c=max(a,c)
print(a)
input()
s=input()
a=c=0
for i in s:
  if i=='I':a+=1
  else:a-=1
  c=max(a,c)
print(c)