import itertools

import math

import fractions

import functools



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

a = []

for i in range(k):

    di = int(eval(input()))

    ai = list(map(int, input().split()))

    a.append(ai)



count = [0] * (n+1)

for i in range(k):

    for j in range(len(a[i])):

        count[a[i][j]] += 1



print((count.count(0)-1))
import itertools

import math

import fractions

import functools

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

a = []

for i in range(k):

    di = int(eval(input()))

    ai = list(map(int, input().split()))

    a.append(ai)



count=set()



for i in range(k):

    for j in range(len(a[i])):

        count.add(a[i][j])



print((n-len(count)))
import itertools
import math
import fractions
import functools

n, k = list(map(int, input().split()))
a = []
for i in range(k):
    di = int(eval(input()))
    ai = list(map(int, input().split()))
    a.append(ai)
count = [0] * (n + 1)
for i in range(k):
    for j in range(len(a[i])):
        count[a[i][j]] += 1
print((count.count(0) - 1))

import itertools
import math
import fractions
import functools

n, k = list(map(int, input().split()))
a = []
for i in range(k):
    di = int(eval(input()))
    ai = list(map(int, input().split()))
    a.append(ai)
count = set()
for i in range(k):
    for j in range(len(a[i])):
        count.add(a[i][j])
print((n - len(count)))

-count = [0] * (n + 1) +count = set() -        count[a[i][j]] += 1 -print((count.count(0) - 1)) +        count.add(a[i][j]) +print((n - len(count)))