#abc052b. [abc052_b]Increment Decrement
[abc052_b]Increment Decrement
Problem Statement
You have an integer variable . Initially, .
Some person gave you a string of length , and using the string you performed the following operation times. In the -th operation, you incremented the value of by if I
, and decremented the value of by if D
.
Find the maximum value taken by during the operations (including before the first operation, and after the last operation).
Constraints
- No characters except
I
andD
occur in .
Input
The input is given from Standard Input in the following format:
Output
Print the maximum value taken by during the operations.
Sample Input 1
5
IIDID
Sample Output 1
2
After each operation, the value of becomes , , , and , respectively. Thus, the output should be , the maximum value.
Sample Input 2
7
DDIDDII
Sample Output 2
0
The initial value is the maximum value taken by , thus the output should be .