N, M = map(int, input().split())

D = [0]*M

for i in range(N):
    A = list(map(int, input().split()))
    A.pop(0)
    for j in A:
        D[j-1] += 1

print(D.count(N)) N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M D = [0]*M D [0]*M [0] 0 M for i in range(N):
    A = list(map(int, input().split()))
    A.pop(0)
    for j in A:
        D[j-1] += 1 i range(N) range N A = list(map(int, input().split())) A list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split A.pop(0) A.pop A pop 0 for j in A:
        D[j-1] += 1 j A D[j-1] += 1 D[j-1] D j-1 j 1 1 print(D.count(N)) print D.count(N) D.count D count N M = map(int, input().split()) map(int, input().split()) M A = list(map(int, input().split())) list(map(int, input().split())) A D = [0]*M [0]*M D N, M = map(int, input().split()) map(int, input().split()) N
N, M = map(int, input().split())

D = [0]*M

for i in range(N):
    A = list(map(int, input().split()))
    A.pop(0)
    for j in A:
        D[j-1] += 1

print(D.count(N))