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

-----Constraints-----
 - 1≤N≤100
 - |S|=N
 - No characters except I and D occur in S.

-----Input-----
The input is given from Standard Input in the following format:
N
S

-----Output-----
Print the maximum value taken by x during the operations.

-----Sample Input-----
5
IIDID

-----Sample Output-----
2

After each operation, the value of x becomes 1, 2, 1, 2 and 1, respectively. Thus, the output should be 2, the maximum value.
[{"code": "N = int(input())\nS = input()\nres = 0\ntmp = 0\nfor s in S:\n  if s == 'I':\n    tmp += 1\n  elif s == 'D':\n    tmp -= 1\n  \n  res = max(res, tmp)\n\nprint(res)\n", "passed": true, "time": 0.14, "memory": 14192.0, "status": "done"}, {"code": "n=int(input())\ns=input()\nx=0\nans=0\nfor i in range(n):\n    if s[i]==\"I\":\n        x+=1\n    else:\n        x-=1\n    ans=max(ans,x)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14316.0, "status": "done"}, {"code": "n = int(input())\ns = list(input())\nmax = x = 0\n\nfor i in s:\n    if i=='I':\n        x += 1\n    else:\n        x -= 1\n    if max < x :\n        max = x\nprint(max)", "passed": true, "time": 0.15, "memory": 14248.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nx = 0\nxl = [0]\nfor i in range(n):\n  if s[i] == \"I\":\n    x += 1\n    xl.append(x)\n  else:\n    x -= 1\n    xl.append(x)\nprint(max(xl))", "passed": true, "time": 0.2, "memory": 14224.0, "status": "done"}, {"code": "n = int(input())\ns = input()\n\nx = 0\nans = 0\nfor a in s:\n    if a == 'I':\n        x += 1\n    else:\n        x -= 1\n    ans = max(ans, x)\nprint(ans)", "passed": true, "time": 0.28, "memory": 14228.0, "status": "done"}, {"code": "N = int(input())\nS = input()\nx = 0\nans = 0\n \nfor i in S:\n  if i == \"I\":\n    x += 1\n  elif i == \"D\":\n    x -= 1\n  ans = max(ans,x)\n  \nprint(ans)", "passed": true, "time": 0.17, "memory": 14284.0, "status": "done"}, {"code": "n = int(input())\ns = input()\n\nans = 0\nx = 0\nfor i in range(n):\n    if s[i] == 'I':\n        x += 1\n    else:\n        x -= 1\n    ans = max(ans, x)\n      \nprint(ans)", "passed": true, "time": 0.15, "memory": 14196.0, "status": "done"}, {"code": "n=int(input())\ns=input()\nx=[0]\nfor i in s:\n    if i==\"I\":\n        x.append(x[-1]+1)\n    else:\n        x.append(x[-1]-1)\nprint(max(x))", "passed": true, "time": 0.14, "memory": 14316.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\nx = 0\nlst = [0]\n\nfor i in range(N):\n   if S[i] == 'I':\n      x += 1\n   else:\n      x -= 1\n   lst.append(x)\n\nprint(max(lst))", "passed": true, "time": 0.15, "memory": 14304.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nres = x = 0\nfor s_ in s:\n  if s_==\"I\":\n    x+=1\n  else:\n    x-=1\n  res = max(res, x)\nprint(res)", "passed": true, "time": 0.14, "memory": 14144.0, "status": "done"}, {"code": "n = int(input())\ns = list(input())\n\nx = 0\nmx = 0\n\nfor a in s:\n  if a == \"I\":\n    x +=1\n  else:\n    x -=1\n  if x > mx:\n    mx = x\n    \nprint(mx)\n", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "n = int(input())\ns = input()\n\nx, ans = 0, 0\nfor o in s:\n    if o == 'I':\n        x += 1 \n    else:\n        x -= 1\n    ans = max(ans, x)\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "N = int(input())\nS = input()\nx = 0\nans = [0]\nfor i in range(N):\n    if S[i] == 'I':\n        x += 1\n    else:\n        x -= 1\n    ans.append(x)\nprint(max(ans))", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\ntmp = 0\nans = 0\nfor i in range(N):\n    if 'I' == S[i]:\n        tmp += 1\n    else:\n        tmp -= 1\n    ans = max(tmp, ans)\nprint(ans)\n", "passed": true, "time": 0.15, "memory": 14240.0, "status": "done"}, {"code": "input();x,r=0,0\nfor i in input():\n  if i=='I': x+=1\n  else: x-=1\n  r=max(r,x)\nprint(r)", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "n = int(input())\na = list(input())\nxlist = [0]\nx = 0\nfor i in range(n):\n  if a[i]==\"D\":\n    x-=1\n  elif a[i]==\"I\":\n    x+=1\n  xlist.append(x)\nprint(max(xlist))", "passed": true, "time": 0.43, "memory": 14236.0, "status": "done"}, {"code": "x=0\nn=int(input())\ns=input()\nl=[0]\nfor i in s:\n    if i==\"I\":\n        x+=1\n        l.append(x)\n    else:\n        x-=1\n        l.append(x)\nprint(max(l))", "passed": true, "time": 1.25, "memory": 14104.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\nans = 0\nhighest = 0\nfor i in S:\n    if i == \"I\":\n        ans += 1\n    else:\n        ans -= 1\n    if highest <= ans:\n        highest = ans \n\nprint(highest)", "passed": true, "time": 0.14, "memory": 14380.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\nmax_num = 0\nidx = 0\nx = 0\nwhile idx < N:\n    if S[idx] == 'I':\n        x += 1\n    else:\n        x -= 1\n    max_num = max(x, max_num)\n    idx += 1\n\nprint(max_num)\n", "passed": true, "time": 0.23, "memory": 14296.0, "status": "done"}, {"code": "N=int(input())\nS=input()\nans=0\ncnt=0\nfor i in range(len(S)):\n  if S[i]=='I':\n    cnt+=1\n  else:\n    cnt-=1\n  ans=max(ans,cnt)\nprint(ans)", "passed": true, "time": 0.22, "memory": 14120.0, "status": "done"}, {"code": "import sys, math\nfrom itertools import combinations as c, product as p\nfrom collections import deque\nsys.setrecursionlimit(10**9)\n\n\ndef si(): return input()\ndef ii(): return int(input())\ndef fi(): return float(input())\ndef lstr(): return input().split()\ndef lint(): return list(map(int, input().split()))\ndef lint_dec(): return list(map(lambda x:int(x) - 1, input().split()))\ndef lnstr(n): return [input() for _ in range(n)]\ndef lnint(n): return [int(input()) for _ in range(n)]\ndef lint_list(n): return [lint() for _ in range(n)]\n\n\n\n############################################################\nN = ii()\nS = si()\nx = 0\nans = 0\n\nfor s in S:\n    if s == 'I':\n        x += 1\n    else:\n        x -= 1\n    ans = max(x, ans)\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14352.0, "status": "done"}, {"code": "n=int(input())\nx=0\nb=[]\ns=input()\nfor S in s:\n    if S=='I':\n        x += 1\n        b.append(x)\n    else:\n        x -= 1\n        b.append(x)\nprint((max(max(b),0)))\n", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "cnt = int(input())\nstring = input()\nx = [0]\n\ni = 0\nfor _ in string:\n    if _ == \"I\":\n        i += 1\n        x.append(i)\n    else:\n        i -= 1\n        x.append(i)\n\nprint(max(x))", "passed": true, "time": 0.15, "memory": 14124.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nx = 0\nm = 0\nfor i in range(n):\n  if s[i] == \"I\":\n    x += 1\n    m = max(m, x)\n  else:\n    x -= 1\nprint(m)", "passed": true, "time": 0.16, "memory": 14088.0, "status": "done"}, {"code": "n = int(input())\ns = str(input())\nx = 0\nmaximum = 0\n\nfor i in range(n):\n    if s[i] == 'I':\n        x += 1\n    elif s[i] == 'D':\n        x -= 1\n    maximum = max(maximum, x)\n\nprint(maximum)", "passed": true, "time": 0.14, "memory": 14332.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nx = ans = 0\nfor i in s:\n  if i == \"I\":\n    x += 1\n  else:\n    x -= 1\n  ans = max(ans,x)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14036.0, "status": "done"}, {"code": "N = int(input())\nS = list(input())\n\ncounter = 0\nli = [0]\nfor i in range(N):\n    if S[i] == 'I':\n        counter +=1\n    else:\n        counter -= 1\n    li.append(counter)\nprint(max(li))", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "N=int(input())\nS=input()\nx=0\nans=0\nfor c in S:\n    if c=='I':\n        x+=1\n        ans=max(ans,x)\n    else:\n        x-=1\nprint(ans)\n", "passed": true, "time": 0.3, "memory": 14108.0, "status": "done"}, {"code": "N = int(input())\nS = str(input())\n\nans = 0\ntmp = 0\nfor i in S:\n  if i == 'I':\n    tmp += 1\n    ans = max(ans, tmp)\n  else:\n    tmp -= 1\nprint(ans)", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "n = int(input())\ns = input()\n\nnum_list = [0]\nsum = 0\nfor w in s:\n  if w == 'I':\n    sum += 1\n  else:\n    sum -= 1\n  num_list.append(sum)\n\nnum_list.sort()\nans = num_list[-1]\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "N = int(input())\nS = input()\nx = 0\nans = 0\nfor s in S:\n    if s == \"I\":\n        x += 1\n    else:\n        x -= 1\n    ans = max(ans, x)\nprint(ans)", "passed": true, "time": 0.15, "memory": 14232.0, "status": "done"}, {"code": "a,b=[input() for i in range(2)]\np=0\nans=0\n\nfor i in b:\n  if i =='I':\n    p+=1\n  elif i =='D' and p>0:\n    p-=1\n  else:\n    p-=1\n  \n  if ans<p:\n    ans=p\n \nprint(ans)", "passed": true, "time": 0.14, "memory": 14080.0, "status": "done"}, {"code": "n = int(input())\ns = input()\n\nx = 0\nans = 0\nfor i in s:\n    if i == 'I':\n        x += 1\n    elif i == 'D':\n        x -= 1\n    ans = max(ans, x)\n\nprint(ans)", "passed": true, "time": 0.16, "memory": 14080.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nx = 0\nl = [0]\nfor a in s:\n    if a == \"I\":\n        x = x + 1\n        l.append(x)\n    else:\n        x = x - 1\n        l.append(x)\n\nprint(max(l))", "passed": true, "time": 0.15, "memory": 14068.0, "status": "done"}, {"code": "N, S = input(), input()\nx, xmax = 0, 0\nfor s in S:\n    x = (lambda a:x+1 if a=='I' else x-1)(s)\n    xmax = max(x,xmax)\nprint(xmax)", "passed": true, "time": 0.32, "memory": 14268.0, "status": "done"}, {"code": "# coding: utf-8\n\nnum = input()\ncount = 0\nmax = 0\nmessage = input()\ntable = list(message)\nfor i in table:\n    if i == \"I\":\n        count += 1\n    elif i == \"D\":\n        count -= 1\n    if max <= count:\n        max = count\nprint(max)", "passed": true, "time": 0.32, "memory": 14012.0, "status": "done"}, {"code": "n = int(input())\ns = list(input())\ncnt = 0\n\nfor i in range(n):\n    cnt = max(cnt, s[0:i+1].count(\"I\") - s[0:i+1].count(\"D\"))\n\nprint(cnt)", "passed": true, "time": 0.14, "memory": 14276.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nx = 0\nans = 0\nfor i in range(n):\n    ans = max(ans, x)\n    if s[i] == 'I':\n        x += 1\n    else :\n        x -= 1\n    ans = max(ans, x)\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14124.0, "status": "done"}, {"code": "x = int(input())\ns = input()\nli = [0]\nc = 0\nfor i in range(x):\n    if s[i] == \"I\":\n        c += 1\n        li.append(c)\n    else:\n        c -= 1\n        li.append(c)\nprint(max(li))", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}, {"code": "N = int(input())\nS = input()\nx = 0\nmax = 0\nfor i in S:\n    if i == 'I':\n        x += 1\n    else:\n        x -= 1\n    if x > max:\n        max = x\nprint(max)", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "n=int(input())\ns=input()\nans=0\nx=0\nfor i in range(n):\n  if s[i]=='I':\n    x+=1\n  else:\n    x-=1\n  ans=max(ans,x)\nprint(ans)", "passed": true, "time": 0.16, "memory": 14192.0, "status": "done"}, {"code": "n = int(input())\ns = input()\n\nm = 0\nx = 0\nfor w in s:\n\tif w == \"I\":\n\t\tx += 1\n\telse:\n\t\tx -= 1\n\t\n\tif x > m:\n\t\tm = x\n\t\t\nprint(m)", "passed": true, "time": 0.15, "memory": 14300.0, "status": "done"}, {"code": "n = int(input())\ns = list(input())\nx = 0\ntmp = 0\nfor i in s:\n    if i == \"I\":\n        x += 1\n    else:\n        x -= 1\n    tmp = max(x, tmp)\nprint(tmp)", "passed": true, "time": 0.17, "memory": 14060.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\nx = 0\nx_list= [0]\nfor s in S:\n    if s == 'I':\n        x += 1\n        x_list.append(x)\n    else:\n        x -= 1\n        x_list.append(x)\n\nprint(max(x_list))", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nx = 0\nc = 0\nfor i in s:\n  if i == \"I\":\n    x += 1\n  else:\n    x -= 1\n  c = max(x,c)\nprint(c)", "passed": true, "time": 0.14, "memory": 14168.0, "status": "done"}, {"code": "def answer(n: int, s: str) -> int:\n    while 'DI' in s:\n        s = s.replace('DI', '')\n\n    return s.count('I')\n\n\ndef main():\n    n = int(input())\n    s = input()\n    print(answer(n, s))\n\n\ndef __starting_point():\n    main()\n__starting_point()", "passed": true, "time": 0.15, "memory": 14004.0, "status": "done"}, {"code": "N=int(input())\nS=input()\na=[]\ntotal=0\nfor i in range(len(S)):\n    if S[i]==\"I\":\n        total+=1\n        a.append(total)\n    else:\n        total-=1\n        a.append(total)\nprint(max(max(a),0))", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "n = int(input())\ns = input()\n\nans = 0\nx = 0\nfor c in s:\n    if c == 'I':\n        x += 1\n    else:\n        x -= 1\n    ans = max(ans, x)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "N = int(input())\nS = str(input())\nmax_int = 0\ncount = 0\nfor i in S:\n    if i == 'I':\n        count +=1\n        max_int = max(max_int, count)\n    elif i == 'D':\n        count -= 1\nprint(max_int)", "passed": true, "time": 0.15, "memory": 14060.0, "status": "done"}, {"code": "N = int(input())\nS = input()\nans = 0\ncnt = 0\nfor i in range(N):\n  if S[i] == 'I':\n    cnt += 1\n    ans = max(ans, cnt)\n  else:\n    cnt -= 1\nprint(ans)", "passed": true, "time": 0.15, "memory": 14288.0, "status": "done"}, {"code": "#-*-coding:utf-8-*-\nimport sys\ninput=sys.stdin.readline\n\ndef main():\n    answers=[0]\n    n = int(input())\n    S = input()\n    x=0\n\n    for s in S:\n        if \"I\" in s:\n            x+=1\n            answers.append(x)\n        elif \"D\" in s:\n            x-=1\n            answers.append(x)\n    print(max(answers))\n\ndef __starting_point():\n    main()\n__starting_point()", "passed": true, "time": 0.14, "memory": 14116.0, "status": "done"}, {"code": "n=int(input())\ns=input()\nx=0\nm = 0\nfor i in range(n):\n  if s[i] == \"I\":\n    x += 1\n    m = max(x, m)\n  else:\n    x -= 1\nprint(m) ", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\nans = 0\ncnt = 0\n\nfor i in range(N):\n  if S[i] == \"I\":\n    cnt += 1\n  elif S[i] == \"D\":\n    cnt -= 1\n  \n  ans = max(ans, cnt)\n  \nprint(ans)", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "N = int(input())\nS = list(input())\nans = 0\nn_ans = 0\nfor i in range(N):\n  if(S[i]=='I'):\n    n_ans += 1\n    ans = max(ans, n_ans)\n  else:\n    n_ans -= 1\n    ans = max(ans, n_ans)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "N = int(input())\nS = input()\nx = 0\nans = 0\n\nfor i in range(len(S)):\n  if S[i] == 'I':\n    x += 1\n    ans = max(x, ans)\n  else:\n    x -= 1\nprint(ans)\n", "passed": true, "time": 0.13, "memory": 14188.0, "status": "done"}, {"code": "N = int(input())\nS = input()\nx = 0\nans = x\n\nfor i in range(N):\n    if S[i]==\"I\":\n        x += 1\n        ans = max(ans, x)\n    else:\n        x -= 1\nprint(ans)", "passed": true, "time": 0.23, "memory": 14328.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nx = 0\ny = 0\n\nfor i in range(n):\n\tif s[i] == 'I':\n\t\tx += 1\n\t\tif x>y:\n\t\t\ty = x\n\telse:\n\t\tx -= 1\n\nprint(y)", "passed": true, "time": 0.4, "memory": 14112.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\nresult = 0\nx = 0\nfor i in S:\n    if i == 'I':\n        x += 1\n    else:\n        x -= 1\n    result = max(result, x)\n\nprint(result)", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "n = int(input())\ns = input()\n\nc = 0\nans = 0\nfor i in list(s):\n    if i == 'I':\n        c+=1\n    else:\n        c-=1\n    ans = max(ans, c)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "n = int(input())\ns = list(map(str, input()))\nmx = 0\nsm = 0\n\nfor char in s:\n    if char == \"I\":\n        sm += 1\n        mx = max(mx, sm)\n    elif char == \"D\":\n        sm -= 1\n    else:\n        continue\n\nprint(mx)", "passed": true, "time": 0.14, "memory": 14224.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nx = 0\nans = x\nfor i in range(n):\n    if s[i] == 'I':\n        x += 1\n    else:\n        x -= 1\n    ans = max(ans,x)\nprint(ans)", "passed": true, "time": 0.15, "memory": 14332.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nmaxnum = 0\ncnt = 0\nfor i in range(len(s)):\n    if s[i] == 'I':\n        cnt += 1\n        if cnt >= maxnum:\n            maxnum = cnt\n    elif s[i] == 'D':\n        cnt -= 1\nprint(maxnum)", "passed": true, "time": 0.14, "memory": 14236.0, "status": "done"}, {"code": "n = int(input())\ns = list(input())\ncount = 0\nmax = 0\nfor i in range(n):\n  \n  if s[i] == \"I\":\n    count += 1\n    if max < count:\n      max = count\n  elif s[i] == \"D\":\n    count -= 1\nprint(max)", "passed": true, "time": 0.45, "memory": 14260.0, "status": "done"}, {"code": "# 31\nN = int(input())\nS = str(input())\n\nans = 0\ncount = 0\nfor i in S:\n    if i == 'I': count += 1\n    elif i == 'D': count -= 1\n    ans = max(ans, count)\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "a=int(input())\nb=input()\nc=0\nd=[0]\nfor i in b:\n    if(i==\"I\"):\n        c+=1\n        d.append(c)\n    elif(i==\"D\"):\n        c-=1\n        d.append(c)\nprint(max(d))", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "N = int(input())\nS = input()\nans = 0\nx = 0\nfor i in S:\n  if i == 'I':\n    x += 1\n    ans = max(ans, x)\n  else:\n    x -= 1\nprint(ans)", "passed": true, "time": 0.18, "memory": 14240.0, "status": "done"}, {"code": "N = int(input())\nS = list(input())\nx = 0\na = [0]\n\nfor s in S:\n  if s == 'I':\n    x += 1\n  else:\n    x -= 1\n  a.append(x)\n\nprint(max(a))", "passed": true, "time": 0.22, "memory": 14312.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nans = 0\nx = 0\nfor i in s:\n  if i == 'I':\n    x += 1\n  else:\n    x -= 1\n  if x > ans:\n    ans = x\nprint(ans)", "passed": true, "time": 0.19, "memory": 14236.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nx = 0\nmaxx = 0\nfor i in range(n):\n    if s[i] == \"I\":\n        x += 1\n        if maxx < x:\n            maxx = x\n    else:\n        x -= 1\nprint(maxx)", "passed": true, "time": 0.14, "memory": 14336.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\nm = 0\nx=0\nfor i in range(N):\n  if S[i] == 'I':\n    x+=1\n    \n  else:\n    x-=1\n    \n  m=max(m,x)\n  \nprint(m)\n", "passed": true, "time": 0.15, "memory": 14216.0, "status": "done"}, {"code": "N = int(input())\nS = input()\nx = 0\nX = [0]*(N+1)\n\nfor i in range(1, N+1):\n    if S[i-1] == \"I\":\n        x += 1\n        X[i] = x\n    else:\n        x -= 1\n        X[i] = x\nprint((max(X)))\n", "passed": true, "time": 0.14, "memory": 14308.0, "status": "done"}, {"code": "N = int(input())\nS = list(input())\nx = 0\nmax = 0\nfor i in range(N):\n    if S[i] == \"I\":\n        x += 1\n    else:\n        x -= 1\n    if x > max:\n        max = x\nprint(max)", "passed": true, "time": 0.16, "memory": 14140.0, "status": "done"}, {"code": "n=int(input())\ns=input()\n\nans=0\nnum=0\nfor i in s:\n  if i==\"I\":\n    num+=1\n    ans=max(ans,num)\n  elif i==\"D\":\n    num-=1\n    ans=max(ans,num)\n    \nprint(ans)\n", "passed": true, "time": 0.15, "memory": 14152.0, "status": "done"}, {"code": "N = int(input())\nS = str(input())\nx = 0\nL = [x]\nfor i in S:\n  if i == 'I':\n    x += 1\n  if i == 'D':\n    x -= 1\n  L.append(x)\nprint((max(L)))\n", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "n = int(input())\ns = str(input())\n\nmax_result = 0\nresult = 0\n\n\nfor i in s:\n    if i == \"I\":\n        result += 1\n        if result > max_result:\n            max_result = result\n    else:\n        result -= 1\n\n\nprint(max_result)", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nx = 0\nres = 0\n\nfor i in range(n):\n    if s[i] == \"I\":\n        x += 1\n    else:\n        x -= 1\n    res = max(res, x)\n\nprint(res)\n", "passed": true, "time": 0.23, "memory": 14260.0, "status": "done"}, {"code": "N = int(input())\nS = input()\nx = 0\nans = 0\nfor i in range(N):\n    if S[i] == 'I':\n        x += 1\n    else:\n        x -= 1\n    ans = max(ans, x)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14196.0, "status": "done"}, {"code": "n = int(input())\nans = list(input())\ncount = 0\na = set()\nfor i in range(n):\n    if ans[i] == 'I':\n        count += 1\n        a.add(count)\n    elif ans[i] == 'D':\n        count -= 1\n        a.add(count)\n\nprint(max(max(a), 0))", "passed": true, "time": 0.14, "memory": 14136.0, "status": "done"}, {"code": "N=int(input())\nS=input()\n\ndef ans052(N:int, S:str):\n    x=0\n    x_list=[0]\n    for i in range(N):\n        if S[i]==\"I\":\n            x+=1\n            x_list.append(x)\n        elif S[i]==\"D\":\n            x-=1\n            x_list.append(x)\n    x_list.sort()\n    return x_list[-1]\n\nprint(ans052(N,S))", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "a=int(input())\nb=input()\nc=0\nd=0\nfor i in range(a):\n  if b[i]==\"D\":\n    c=c-1\n  if b[i]==\"I\":\n    c=c+1\n  if c>d:\n    d=c\nprint(d)", "passed": true, "time": 0.15, "memory": 14052.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\nx = 0\nx_max = x\n\nfor c in S:\n    if c == \"I\":\n        x += 1\n        if x > x_max:\n            x_max = x\n    elif c == \"D\":\n        x -= 1\n\nprint(x_max)", "passed": true, "time": 0.14, "memory": 14100.0, "status": "done"}, {"code": "n = int(input())\ns = input()\ncount = 0\nx  = 0\nfor i in range(n):\n    if s[i] == \"I\":\n        x += 1\n    else:\n        x -= 1\n    count = max(count, x)\nprint(count)", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "n=int(input())\ns=str(input())\nans=0\nm=0\nfor i in range(n):\n  if s[i]==\"I\":\n    ans+=1\n    m=max(m,ans)\n  else:\n    ans-=1\n\nprint(m)\n", "passed": true, "time": 0.14, "memory": 14096.0, "status": "done"}, {"code": "N=int(input())\nS=input()\nx=0\nans=0\nfor i in range(N):\n    if S[i]=='I':\n        x+=1\n    else:\n        x-=1\n    ans=max(ans,x)\nprint(ans)", "passed": true, "time": 0.23, "memory": 14304.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nres = 0\nans = 0\nfor i in range(n):\n  if s[i] == \"D\":\n    res -= 1\n  else:\n    res += 1\n  ans = max(res,ans)\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "# -*- coding:utf-8 -*-\nN = int(input())\nS = input()\n\nans = 0\nmax = 0\n\nfor s in S:\n    if s == 'I':\n        ans += 1\n    else:\n        ans -= 1\n    \n    if max < ans:\n        max = ans\n\nprint(max)", "passed": true, "time": 0.23, "memory": 14124.0, "status": "done"}, {"code": "x = 0\nmx = 0\nn = int(input())\ns = input()\n\nfor c in s:\n    if c == 'I':\n        x += 1\n    else:\n        x -= 1\n    mx = max(mx, x)\n\nprint(mx)\n", "passed": true, "time": 0.14, "memory": 14328.0, "status": "done"}, {"code": "N = int(input())\nS = input()\nans = 0\nans_tmp = 0\nfor s in S:\n  if s==\"I\":\n    ans_tmp += 1\n    ans = max(ans_tmp, ans)\n  else:\n    ans_tmp -= 1\nprint(ans)", "passed": true, "time": 0.23, "memory": 14316.0, "status": "done"}, {"code": "N,S=int(input()),input()\nprint(max([(t:=S[:m+1]).count(\"I\")-t.count(\"D\") for m in range(N)]+[0]))", "passed": true, "time": 0.15, "memory": 14172.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nx = 0\nans = 0\nfor i in s:\n    if i == 'I':\n        x+=1\n    elif i == 'D':\n        x-=1\n    ans = max(ans,x)\nprint(ans)", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "n = int(input())\ns = str(input())\nx = 0\na = 0\nfor i in s:\n    if i == 'I':\n        x += 1\n        if x > a:\n            a = x\n    else:\n        x -= 1\nprint(a)", "passed": true, "time": 0.15, "memory": 14304.0, "status": "done"}, {"code": "N = int(input())\nS = input()\n\nx = 0\nans = 0\nfor i in S:\n    if i == 'I':\n        x += 1\n    elif i == 'D':\n        x -= 1\n    ans = max(x, ans)\nprint(ans)", "passed": true, "time": 0.15, "memory": 14072.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nmax = 0\nsum = 0\nfor i in s:\n    if(i == 'I'):\n        sum += 1\n        if(max < sum):\n            max = sum\n    else:\n        sum -= 1\nprint(max)", "passed": true, "time": 0.14, "memory": 14068.0, "status": "done"}, {"code": "def main():\n    input()\n    s = input()\n    tmp = 0\n    ans = 0\n    for v in s:\n        if v == \"I\":\n            tmp += 1\n        else:\n            tmp -= 1\n        ans = max(ans, tmp)\n    print(ans)\n\n\ndef __starting_point():\n    main()\n__starting_point()", "passed": true, "time": 0.13, "memory": 14200.0, "status": "done"}, {"code": "n = int(input())\ns = input()\nx = 0\nans = [0]\n\nfor c in s:\n    if c == 'I':\n        x += 1\n    else:\n        x -= 1\n    ans.append(x)\nprint(max(ans))", "passed": true, "time": 0.14, "memory": 14148.0, "status": "done"}, {"code": "N = int(input())\nS = str(input())\n\nM = 0\nSum = 0\n\nfor x in S:\n    if x == 'I':\n        Sum += 1\n    else:\n        Sum -= 1\n    M = max(M, Sum)\n\nprint(M)\n", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "N = int(input())\nS = list(input())\n\nx = 0\nmaxi = 0\n\nfor i in S:\n    if i == 'I':\n        x += 1\n    else:\n        x -= 1\n\n    if x > maxi:\n        maxi = x\n\nprint(maxi)", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "input()\n\ncur = 0\nmax_value = 0\nfor c in input():\n  x = 1 if c == 'I' else -1\n  cur += x\n  max_value = max(max_value, cur)\n  \nprint(max_value)", "passed": true, "time": 0.14, "memory": 14064.0, "status": "done"}]