Limits
1s, 512 MB

This problem is very easy. As my mood is not so good, I will not elaborate the statement unnecessarily. In this problem you will be given **N** sets. Each of them will contain some distinct integer numbers. You have to form a new set using some chosen sets from given sets in a way such that there is *no common element* among the chosen sets and the number of total elements in the newly formed set is the *maximum* possible.

In first line there will be an integer **T**, denoting the number of testcases.

In the first line of each test case there will be an integer **N**, denoting the number of sets. Then each of the next **N** lines will contain some integers. The first integer is **Mi**, the number of elements in **ith** set. And then there will be **Mi** space separated distinct integers **A1**, **A2**, ....**Aj**, ..., **AMi** denoting the elements of the **ith** set.

summation of **M**i over all testcases will not exceed **3×106**

**Constraints:**

Subtask 1 (10 points):

1 ≤ **T** ≤ 10

1 ≤ **N** ≤ 10

1 ≤ **M**i ≤ 100

1 ≤ **A**j ≤ 1000

Subtask 2 (90 Points):

1 ≤ **T** ≤ 10

1 ≤ **N** ≤ 20

1 ≤ **M**i ≤ 100000

1 ≤ **A**j ≤ 1018

For each test case, print the size of the newly formed set.

Input | Output |
---|---|

1 3 2 1 2 2 2 3 2 1 3 | 2 |