Consider a vector of length 10 with all components being zero. Given a sequence of operations on the vector, compute the sum of the vector after carrying out all of the operations. The operations are presented in a format as follows:
3 A 10
2 A 30
5 A 70
2 S 50
3 S 6
5 S 68
where 'A' is for addition and 'S' is for subtraction. The first operation "3 A 10" means that 10 is added to the third component. The second operation "2 A 30" means that 30 is added to the second component, and so on. The last operation means that 68 is subtracted from the fifth component. Note that the components of the vector cannot be negative. Therefore, if an operation will cause some component to become negative, that operation is ignored and does not make any change to the vector. For example, the forth operation "2 S 50" in the above sequence will be ignored since at that moment the value of the second component is only 30, which is not enough for subtracting 50.
The final sum of the vector after the above operations will be 36.
The first line is an integer N (1<=N<=1000) denoting the number of operations.
The next N lines contain the N operations in the form of
Component_Index Add_Or_Subtract Component_Value
Component_Index is within the range from 1 to 10. Component_Value is a positive integer.
The output is a line that presents the sum of the vector after the operations. Be sure to add a newline character '\n' at the end.