from collections import Counter
import itertools
n, k = map(int, input().split())
d = []
sunuke = []
for i in range(k):
    d.append(int(input()))
    sunuke.append(list(map(int, input().split())))
new = list(itertools.chain.from_iterable(sunuke))
c = Counter(new)
print(n - len(c))

16f4f38507c97fc928284edc529044796786713e
<mask token>

<mask token>
for i in range(k):
    d.append(int(input()))
    sunuke.append(list(map(int, input().split())))
<mask token>
print(n - len(c))

<mask token>
n, k = map(int, input().split())
d = []
sunuke = []
for i in range(k):
    d.append(int(input()))
    sunuke.append(list(map(int, input().split())))
new = list(itertools.chain.from_iterable(sunuke))
c = Counter(new)
print(n - len(c))

from collections import Counter
import itertools
n, k = map(int, input().split())
d = []
sunuke = []
for i in range(k):
    d.append(int(input()))
    sunuke.append(list(map(int, input().split())))
new = list(itertools.chain.from_iterable(sunuke))
c = Counter(new)
print(n - len(c))
