N, M = map(int, input().split())
A = [list(map(int, input().split())) for _ in range(N)]
L = [0] * M
for i in range(N):
    for j in range(1, A[i][0] + 1):
        L[ A[i][j] -1 ] += 1
print(L.count(N)) 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 A = [list(map(int, input().split())) for _ in range(N)] A [list(map(int, input().split())) for _ in range(N)] L = [0] * M L [0] * M [0] 0 M for i in range(N):
    for j in range(1, A[i][0] + 1):
        L[ A[i][j] -1 ] += 1 i range(N) range N for j in range(1, A[i][0] + 1):
        L[ A[i][j] -1 ] += 1 j range(1, A[i][0] + 1) range 1 A[i][0] + 1 A[i][0] [i] A i 0 1 L[ A[i][j] -1 ] += 1 L[ A[i][j] -1 ] L A[i][j] -1 A[i][j] [i] A i j 1 1 print(L.count(N)) print L.count(N) L.count L count N N, M = map(int, input().split()) map(int, input().split()) N M = map(int, input().split()) map(int, input().split()) M A = [list(map(int, input().split())) for _ in range(N)] [list(map(int, input().split())) for _ in range(N)] A L = [0] * M [0] * M L
N, M = map(int, input().split())
A = [list(map(int, input().split())) for _ in range(N)]
L = [0] * M
for i in range(N):
    for j in range(1, A[i][0] + 1):
        L[ A[i][j] -1 ] += 1
print(L.count(N))
