N, M = map(int, input().split())
a = [set(input().split()[1:]) for _ in range(N)]
 
like = a[0]
for i in range(1, N):
    like = like & a[i]
print(len(like)) N, M = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split M set(input().split()[1:]) for _ in range(N) for _ in range(N) _ range(N) range N for _ in range(N) set(input().split()[1:]) set input().split()[1:] ().split() ().split () input split 1: 1 a = [set(input().split()[1:]) for _ in range(N)] a [set(input().split()[1:]) for _ in range(N)] like = a[0] like a[0] a 0 for i in range(1, N):
    like = like & a[i] i range(1, N) range 1 N like = like & a[i] like like & a[i] like a[i] a i print(len(like)) print len(like) len like M = map(int, input().split()) map(int, input().split()) M N, M = map(int, input().split()) map(int, input().split()) N like = a[0] a[0] like like = like & a[i] like & a[i] like a = [set(input().split()[1:]) for _ in range(N)] [set(input().split()[1:]) for _ in range(N)] a
N, M = map(int, input().split())
a = [set(input().split()[1:]) for _ in range(N)]
 
like = a[0]
for i in range(1, N):
    like = like & a[i]
print(len(like))