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

ans_dict = {}

for i in range(N):
    for j in range(1, favorites[i][0] + 1):
        food = favorites[i][j]
        if food in ans_dict:
            ans_dict[food] += 1
        else:
            ans_dict[food] = 1

count = 0
for k, v in ans_dict.items():
    if v == N:
        count += 1

print(count) N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M list(map(int, input().split())) for _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split favorites = [list(map(int, input().split())) for _ in range(N)] favorites [list(map(int, input().split())) for _ in range(N)] ans_dict = {} ans_dict {} for i in range(N):
    for j in range(1, favorites[i][0] + 1):
        food = favorites[i][j]
        if food in ans_dict:
            ans_dict[food] += 1
        else:
            ans_dict[food] = 1 i range(N) range N for j in range(1, favorites[i][0] + 1):
        food = favorites[i][j]
        if food in ans_dict:
            ans_dict[food] += 1
        else:
            ans_dict[food] = 1 j range(1, favorites[i][0] + 1) range 1 favorites[i][0] + 1 favorites[i][0] [i] favorites i 0 1 food = favorites[i][j] food favorites[i][j] [i] favorites i j if food in ans_dict:
            ans_dict[food] += 1
        else:
            ans_dict[food] = 1 food in ans_dict food ans_dict ans_dict[food] += 1 ans_dict[food] ans_dict food 1 ans_dict[food] = 1 ans_dict[food] ans_dict food 1 count = 0 count 0 for k, v in ans_dict.items():
    if v == N:
        count += 1 k v ans_dict.items() ans_dict.items ans_dict items if v == N:
        count += 1 v == N v N count += 1 count 1 print(count) print count favorites = [list(map(int, input().split())) for _ in range(N)] [list(map(int, input().split())) for _ in range(N)] favorites N, M = map(int, input().split()) map(int, input().split()) N count += 1 1 count M = map(int, input().split()) map(int, input().split()) M ans_dict = {} {} ans_dict food = favorites[i][j] favorites[i][j] food count = 0 0 count
N, M = map(int, input().split())
favorites = [list(map(int, input().split())) for _ in range(N)]

ans_dict = {}

for i in range(N):
    for j in range(1, favorites[i][0] + 1):
        food = favorites[i][j]
        if food in ans_dict:
            ans_dict[food] += 1
        else:
            ans_dict[food] = 1

count = 0
for k, v in ans_dict.items():
    if v == N:
        count += 1

print(count)
