A. My Friend of Misery
time limit per test
3 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

With the SCPC2015 getting closer, Noura Boubou, SCPC Head of Media, was very busy to the extent of not having time to recharge her phone's credit balance. However, her best friend, Nicole, was kind enough to transfer her own credit for the sake of keeping Noura online 24/7.

The phone credit transfer system in Syria works in the following way: Each successful transfer operation withdraws 25 extra credit units from the sender's balance, but it doesn't cost anything when a transfer operation is unsuccessful due to non sufficient credit balance.

Given the log of credit transfer requests and the response from the system to each request, in the form: Amount of transfer, and result of operation (either successful or unsuccessful), can you find out the number of possible initial credit balance values that Nicole could have had which satisfy the given log file?

Note that the initial credit balance is always a non negative integer.

Input

The first line of input contains an integer T (1 ≤ T ≤ 256), the number of test cases.

The first line of each test case contains an integer N (1 ≤ N ≤ 105), the number of operations in the log of credit transfer requests.

Each of the following N lines contains an integer mi (1 ≤ mi ≤ 106), the amount of credit to transfer, followed by .

  • { + } denotes a successful operation.
  • { - } denotes an unsuccessful operation.

Each log contains at least one unsuccessful operation.

Output

For each test case, print a single line that contains the number of possible initial credit balance values that Nicole could have had.

Examples
Input
3
3
512 -
128 +
256 +
4
80 +
70 +
200 -
150 +
3
100 -
100 -
540 -
Output
103
50
125
Note

Warning: large Input/Output data, be careful with certain languages.