N,M = [int(i) for i in input().split()]

ans = [0]*M
for i in range(N):
    K,*A = [int(j) for j in input().split()]
    for k in range(K):
        ans[A[k]-1] += 1

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

ans = [0]*M
for i in range(N):
    K,*A = [int(j) for j in input().split()]
    for k in range(K):
        ans[A[k]-1] += 1

print(ans.count(N))
