n,m = map(int,input().split())
a = [list(map(int,input().split(" "))) for i in range(n)]
f = [n] * m
for i in range(n):
    for j in range(a[i][0]):
        f[a[i][j+1]-1] -= 1
print(f.count(0)) 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 i in range(n) for i in range(n) i range(n) range n for i 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 i in range(n)] a [list(map(int,input().split(" "))) for i in range(n)] f = [n] * m f [n] * m [n] n m for i in range(n):
    for j in range(a[i][0]):
        f[a[i][j+1]-1] -= 1 i range(n) range n for j in range(a[i][0]):
        f[a[i][j+1]-1] -= 1 j range(a[i][0]) range a[i][0] [i] a i 0 f[a[i][j+1]-1] -= 1 f[a[i][j+1]-1] f a[i][j+1]-1 a[i][j+1] [i] a i j+1 j 1 1 1 print(f.count(0)) print f.count(0) f.count f count 0 f = [n] * m [n] * m f 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 i in range(n)] [list(map(int,input().split(" "))) for i in range(n)] a
n,m = map(int,input().split())
a = [list(map(int,input().split(" "))) for i in range(n)]
f = [n] * m
for i in range(n):
    for j in range(a[i][0]):
        f[a[i][j+1]-1] -= 1
print(f.count(0))