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).
s = input()

x = 0
mx = 0
for c in s:
    if c == 'I':
        x += 1
    if c == 'D':
        x -= 1
    if x > mx:
        mx = x
print(max(x, mx))
n = input()
s = input()

x = 0
mx = 0
for c in s:
    if c == 'I':
        x += 1
    if c == 'D':
        x -= 1
    mx = max(x, mx)
print(max(x, mx))