n, m = map(int, input().split())
fset = set([i for i in range(1, m + 1)])
allset = fset
for i in range(n):
  temp = set(list(map(int, input().split()))[1:])
  fset = fset - (allset - temp)
print(len(fset)) n, m = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split m i for i in range(1, m + 1) for i in range(1, m + 1) i range(1, m + 1) range 1 m + 1 m 1 for i in range(1, m + 1) i fset = set([i for i in range(1, m + 1)]) fset set([i for i in range(1, m + 1)]) set [i for i in range(1, m + 1)] allset = fset allset fset for i in range(n):
  temp = set(list(map(int, input().split()))[1:])
  fset = fset - (allset - temp) i range(n) range n temp = set(list(map(int, input().split()))[1:]) temp set(list(map(int, input().split()))[1:]) set list(map(int, input().split()))[1:] (map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split 1: 1 fset = fset - (allset - temp) fset fset - (allset - temp) fset allset - temp allset temp print(len(fset)) print len(fset) len fset n, m = map(int, input().split()) map(int, input().split()) n temp = set(list(map(int, input().split()))[1:]) set(list(map(int, input().split()))[1:]) temp fset = set([i for i in range(1, m + 1)]) set([i for i in range(1, m + 1)]) fset m = map(int, input().split()) map(int, input().split()) m allset = fset fset allset fset = fset - (allset - temp) fset - (allset - temp) fset
n, m = map(int, input().split())
fset = set([i for i in range(1, m + 1)])
allset = fset
for i in range(n):
  temp = set(list(map(int, input().split()))[1:])
  fset = fset - (allset - temp)
print(len(fset))