Hugh Hockey is a very big hockey fan. Every Saturday night he sits and watches all the hockey games, never wanting to miss a moment. Every Canadian loves hockey.
Not this Saturday night though. Hugh Hockey has a date, so he trained his three year-old brother Billy to record the scores for him. He sits Billy in front of his TV, teaches him how to change the channels, and tells him to write down the hockey scores.
Hugh returns home, after his date, to a surprise: he discovers that even though Billy wrote down the scores, Billy didn't write down the names of the teams. He also discovered that Billy not only wrote down the final scores, but also the scores of games in progress. To make matters worse, Billy didn't follow any specific order when writing down the score of a game; A score of two-to-one could have been written down as
1-2. There's no guarantee that Billy wrote down every score, some could be missed.
Help Hugh figure out, from Billy's list, the minimum number of hockey games that occurred, so Hugh knows, sadly, how much hockey he's missed.
Input consists of a series of test cases. The first line consists of an integer , the number of test cases.
For each test case, the first line consists of the integer , the number of hockey scores recorded by Billy. The next s lines each contain a hockey score in the form
x-y, where and are non-negative integers.
For each test case, output on a single line the integer , the minimum number of games that must have occurred such that each score Billy recorded occurs in a game sometime during the night.
2 4 1-0 2-0 0-3 2-1 4 0-0 5-0 1-3 2-2