N,M=map(int,input().split())
KA=[]
food=[N]*M
for i in range(N):
    KA.append(list(map(int,input().split())))
for i in range(N):
    for j in range(len(KA[i])-1):
        food[KA[i][j+1]-1]-=1
print(food.count(0)) N,M=map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split M KA=[] KA [] food=[N]*M food [N]*M [N] N M for i in range(N):
    KA.append(list(map(int,input().split()))) i range(N) range N KA.append(list(map(int,input().split()))) KA.append KA append list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split for i in range(N):
    for j in range(len(KA[i])-1):
        food[KA[i][j+1]-1]-=1 i range(N) range N for j in range(len(KA[i])-1):
        food[KA[i][j+1]-1]-=1 j range(len(KA[i])-1) range len(KA[i])-1 len(KA[i]) len KA[i] KA i 1 food[KA[i][j+1]-1]-=1 food[KA[i][j+1]-1] food KA[i][j+1]-1 KA[i][j+1] [i] KA i j+1 j 1 1 1 print(food.count(0)) print food.count(0) food.count food count 0 food=[N]*M [N]*M food N,M=map(int,input().split()) map(int,input().split()) N M=map(int,input().split()) map(int,input().split()) M KA=[] [] KA
N,M=map(int,input().split())
KA=[]
food=[N]*M
for i in range(N):
    KA.append(list(map(int,input().split())))
for i in range(N):
    for j in range(len(KA[i])-1):
        food[KA[i][j+1]-1]-=1
print(food.count(0))