n,k = list(map(int,input().split()))

people = list(range(1,n+1))



li = []

for i in range(k) :

  gomi = eval(input())

  [li.append(int(j)) for j in input().split()]

st = set(li)

  

ans = 0

for i in people :

  if not i in st :

    ans += 1

print(ans)
n,k = list(map(int,input().split()))



li = []

for i in range(k) :

  gomi = eval(input())

  [li.append(int(j)) for j in input().split()]

st = set(li)

  

print((n - len(st)))
n, k = list(map(int, input().split()))
people = list(range(1, n + 1))
li = []
for i in range(k):
    gomi = eval(input())
    [li.append(int(j)) for j in input().split()]
st = set(li)
ans = 0
for i in people:
    if not i in st:
        ans += 1
print(ans)

n, k = list(map(int, input().split()))
li = []
for i in range(k):
    gomi = eval(input())
    [li.append(int(j)) for j in input().split()]
st = set(li)
print((n - len(st)))

-people = list(range(1, n + 1)) -ans = 0 -for i in people: -    if not i in st: -        ans += 1 -print(ans) +print((n - len(st)))