N, M = map(int, input().split())
love_count = [0 for _ in range(M)]

for _ in range(N):
    K, *A = input().split()
    for a in A:
        love_count[int(a)-1] += 1

count = 0
for num in love_count:
    if num == N:
        count += 1

print(count) N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M 0 for _ in range(M) for _ in range(M) _ range(M) range M for _ in range(M) 0 love_count = [0 for _ in range(M)] love_count [0 for _ in range(M)] for _ in range(N):
    K, *A = input().split()
    for a in A:
        love_count[int(a)-1] += 1 _ range(N) range N K, *A = input().split() K input().split() ().split () input split *A A for a in A:
        love_count[int(a)-1] += 1 a A love_count[int(a)-1] += 1 love_count[int(a)-1] love_count int(a)-1 int(a) int a 1 1 count = 0 count 0 for num in love_count:
    if num == N:
        count += 1 num love_count if num == N:
        count += 1 num == N num N count += 1 count 1 print(count) print count K, *A = input().split() input().split() K count += 1 1 count M = map(int, input().split()) map(int, input().split()) M N, M = map(int, input().split()) map(int, input().split()) N love_count = [0 for _ in range(M)] [0 for _ in range(M)] love_count count = 0 0 count
N, M = map(int, input().split())
love_count = [0 for _ in range(M)]

for _ in range(N):
    K, *A = input().split()
    for a in A:
        love_count[int(a)-1] += 1

count = 0
for num in love_count:
    if num == N:
        count += 1

print(count)