N,M = [int(i) for i in input().split()]
s = [0]*M
for _ in range(N):
    K,*A = [int(i) for i in input().split()]
    for i in A:
        s[i-1] += 1
print(s.count(N)) int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i N,M = [int(i) for i in input().split()] N [int(i) for i in input().split()] M s = [0]*M s [0]*M [0] 0 M for _ in range(N):
    K,*A = [int(i) for i in input().split()]
    for i in A:
        s[i-1] += 1 _ range(N) range N int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i K,*A = [int(i) for i in input().split()] K [int(i) for i in input().split()] *A A for i in A:
        s[i-1] += 1 i A s[i-1] += 1 s[i-1] s i-1 i 1 1 print(s.count(N)) print s.count(N) s.count s count N K,*A = [int(i) for i in input().split()] [int(i) for i in input().split()] K N,M = [int(i) for i in input().split()] [int(i) for i in input().split()] N M = [int(i) for i in input().split()] [int(i) for i in input().split()] M s = [0]*M [0]*M s
N,M = [int(i) for i in input().split()]
s = [0]*M
for _ in range(N):
    K,*A = [int(i) for i in input().split()]
    for i in A:
        s[i-1] += 1
print(s.count(N))