n, m = map(int, input().split())
foods = [0] * (m + 1)
for i in range(n):
    k, *a = map(int, input().split())
    for j in a:
        foods[j] += 1

print(foods.count(n)) n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m foods = [0] * (m + 1) foods [0] * (m + 1) [0] 0 m + 1 m 1 for i in range(n):
    k, *a = map(int, input().split())
    for j in a:
        foods[j] += 1 i range(n) range n k, *a = map(int, input().split()) k map(int, input().split()) map int input().split() ().split () input split *a a for j in a:
        foods[j] += 1 j a foods[j] += 1 foods[j] foods j 1 print(foods.count(n)) print foods.count(n) foods.count foods count n m = map(int, input().split()) map(int, input().split()) m n, m = map(int, input().split()) map(int, input().split()) n k, *a = map(int, input().split()) map(int, input().split()) k foods = [0] * (m + 1) [0] * (m + 1) foods
n, m = map(int, input().split())
foods = [0] * (m + 1)
for i in range(n):
    k, *a = map(int, input().split())
    for j in a:
        foods[j] += 1

print(foods.count(n))