There are 'n' ants on a 'n+1' length rod. The ants are numbered from 1 to n and are initially placed at positions starting from position 1 till position n. They are moving either in left direction (denoted by '-1') or in the right direction (denoted by '1'). Whenever an ant crosses the boundary of the rod it falls off the rod. You are given the initial direction of the ants. Now, whenever two ants collide their direction switches, i.e. the ant going in left direction ('-1) changes it's direction towards right ('1') and the ant going in the right direction ('1') changes it's direction towards left ('-1'). 
Find last ant to fall off the rod. 

Note: In case two ants are falling simultaneously in the end print the index of the lower indexed ant. 

Input Format:

First line contains number of test cases and second line contains the integer 'n' denoting the total number of ants s.t. 1 ≤ n ≤ 1,000
Second line contains 'n' space separated numbers (either '1' or '-1') denoting the initial directions of the ants. 

Output Format:

Output a single integer which is the index (lower index in case two ants are falling simultaneously in the end) of the last ant to fall off the table.

SAMPLE INPUT
2
2
1 1
8
1 1 -1 1 1 1 -1 1

SAMPLE OUTPUT
1
3
'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
T = input()
for t in xrange(T):
	n = input()
	directions = map(int, raw_input().split())
	p = len([x for x in directions if x == 1])
	n = len([x for x in directions if x == -1])
	if p > n:
		print n + 1
	else:
		print n