AT_past18_e 共通部分

Description

There are $ N $ sets of integers: $ S_1, S_2, \dots, S_N $ . $ S_i $ contains $ C_i $ integers, $ A_{i, 1}, \dots, A_{i, C_i} $ , in ascending order. Among the ways to choose two or more of the sets, how many of them satisfy the following condition? - The intersection of the chosen sets contains only odd numbers. Here, the intersection of chosen sets is the set consisting of the integers contained in all of the chosen sets.

Input Format

The input is given from Standard Input in the following format: > $ N $ $ C_1 $ $ A_{1,1} $ $ A_{1,2} $ $ \dots $ $ A_{1,C_1} $ $ C_2 $ $ A_{2,1} $ $ A_{2,2} $ $ \dots $ $ A_{2,C_2} $ $ \vdots $ $ C_N $ $ A_{N,1} $ $ A_{N,2} $ $ \dots $ $ A_{N,C_N} $

Output Format

Print the answer.

Explanation/Hint

### Sample Explanation 1 We enumerate the possible choices of sets, their intersections, and whether they satisfy the condition: - The intersection of $ S_1 $ and $ S_2 $ is $ \lbrace 1, 5 \rbrace $ , which satisfies the condition. - The intersection of $ S_1 $ and $ S_3 $ is $ \lbrace 2 \rbrace $ , which does not satisfy the condition. - The intersection of $ S_2 $ and $ S_3 $ is $ \lbrace 3 \rbrace $ , which satisfies the condition. - The intersection of $ S_1 $ , $ S_2 $ , and $ S_3 $ is $ \lbrace \rbrace $ (an empty set), which satisfies the condition. Note that the condition is satisfied even when the intersection is an empty set. ### Constraints - $ 2 \leq N \leq 10 $ - $ 1 \leq C_i \leq 10 $ - $ 1 \leq A_{i,1} \lt A_{i,2} \lt \dots \lt A_{i,C_i} \leq 100 $ - All input values are integers.