import std.algorithm;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;

void main ()
{
	auto tests = readln.strip.to !(int);
	foreach (test; 0..tests)
	{
		auto n = readln.strip.to !(int);
		auto a = readln.splitter.map !(to !(int)).array;
		int [int] k;
		foreach (ref c; a)
		{
			k[abs (c)] += 1;
			k[abs (c)] = min (k[abs (c)], 1 + (c != 0));
		}
		k.byValue.sum.writeln;
	}
}
