Jarek hosted this year's New Year's Eve party. Throughout the evening he tried to keep a record of everyone entering and leaving, but he is worried that he missed a few entries and exits.
Jarek's record has N items, each in one of two forms:
1 means one person entered.-1 means one person left.Given that Jarek's house was empty both before the party started and after it ended, find the minimum number of guest entries or exits that Jarek missed.
The first line contains a natural number Z (1≤Z≤10), the number of test sets. The test sets follow, one after another.
The first line of each test set contains a natural number N (1≤N≤106), the number of items in Jarek's record. Each of the next N lines contains one item of the record, and each item has the form and meaning described above.
For each test set, print on its own line the minimum number of items missing from Jarek's record.