Problem:
 Score : 200 points    Problem Statement N  Snukes called Snuke 1 , Snuke 2 , ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1 , Snack 2 , ..., Snack K . The following d_i Snukes have Snack i : Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}} .  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?      Constraints  All values in input are integers.  1 \leq N \leq 100  1 \leq K \leq 100  1 \leq d_i \leq N  1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N         Input Input is given from Standard Input in the following format:  N  K  d_1  A_{1, 1} \cdots A_{1, d_1}  \vdots  d_K  A_{K, 1} \cdots A_{K, d_K}       Output Print the answer.        Sample Input 1 3 2
2
1 3
1
3      Sample Output 1 1   Snuke 1 has Snack 1 .  Snuke 2 has no snacks.  Snuke 3 has Snack 1 and 2 .   Thus, there will be one victim: Snuke 2 .       Sample Input 2 3 3
1
3
1
3
1
3      Sample Output 2 2

Solution (Python):
from __future__ import annotations

import unittest
from dataclasses import dataclass, field
from typing import List


@dataclass
class Sweet:
    id: int


@dataclass
class User:
    id: int
    sweets: List[Sweet] = field(default_factory=list)

    def register_sweet(self, sweet: Sweet) -> None:
        if sweet not in self.sweets:
            self.sweets.append(sweet)

    def has_no_sweets(self) -> bool:
        return len(self.sweets) == 0


@dataclass(frozen=True)
class Users:
    values: List[User] = field(default_factory=list)

    def add(self, user: User) -> Users:
        return Users(self.values + [user])

    def __len__(self) -> int:
        return len(self.values)

    def __getitem__(self, index: int) -> User:
        return self.values[index]

    @classmethod
    def create(cls, num_people: int) -> Users:
        return Users([User(id=i) for i in range(1, num_people + 1)])

    def count_users_has_no_sweets(self) -> int:
        return len([user for user in self.values if user.has_no_sweets()])

    def find_by(self, user_id: int) -> User:
        idx = user_id - 1

        return self.values[idx]


def answer(num_people: int, sweet_id_list: List[int], sweets_distribute_list: List[List[int]]):
    users = Users.create(num_people)

    for sweet_id, distribute_list in zip(sweet_id_list, sweets_distribute_list):
        sweet = Sweet(id=sweet_id)

        for user_id in distribute_list:
            user = users.find_by(user_id)
            user.register_sweet(sweet)

    return users.count_users_has_no_sweets()

  
  
num_people, num_sweets = map(int, input().split())

sweet_id_list = []
sweets_distribute_list = []
for i in range(num_sweets):
	d = int(input())
	sweet_id_list.append(d)
	has_list = list(map(int, input().split()))
	sweets_distribute_list.append(has_list)

print(answer(num_people, sweet_id_list, sweets_distribute_list))

Solution (Python):
from dataclasses import dataclass, field
from typing import List


@dataclass
class Sweet:
    number: int


@dataclass
class User:
    number: int
    sweets: List[Sweet] = field(default_factory=list)

    def hoge(self):
        return [u.number for u in self.sweets]


def answer(num_people: int, num_sweets: int, d_list: List[int], okasi_list: List[List[int]]):
    user_list = [User(number=i) for i in range(1, num_people + 1)]

    for d, who_has_list in zip(d_list, okasi_list):
        for idx in who_has_list:
            user = user_list[idx - 1]
            user.sweets.append(Sweet(number=d))

    x = [len(u.sweets) for u in user_list]

    return x.count(0)

  
  
num_people, num_sweets = map(int, input().split())

d_list = []
okasi_list = []
for i in range(num_sweets):
	d = int(input())
	d_list.append(d)
	has_list = list(map(int, input().split()))
	okasi_list.append(has_list)




print(answer(num_people, num_sweets, d_list, okasi_list))

Solution (Python):
n, k = list(map(lambda x: int(x),input().split(' ')))

has_cookie = []
for i in range(k):
  cookie_num = int(input())
  has_cookie.extend(list(map(lambda x: int(x), input().split(' '))))

has_cookie = list(set(has_cookie))

print(n - len(has_cookie))

Solution (Python):
N, K = map(int, input().split())

d_list = []
A_set = set()

for _ in range(K):
  d = int(input())
  d_list.append(d)
  
  A = map(int, input().split())
  A_set = A_set | set(A)
  
print(N - len(A_set))

Solution (Python):
n,k = map(int,input().split())
mp = [0]*(n+1)
for i in range(k):
  d = int(input())
  a = list(map(int,input().split()))
  for j in a:
    mp[j]+=1
res = 0
for i in range(1,n+1):
  if mp[i]==0:
    res+=1
print(res)

Solution (Python):
N,K = (int(x) for x in input().split())

people_list = [0 for i in range(N)]

for i in range(K):
  input()
  for x in input().split():
    people_list[int(x)-1] += 1
    
num = 0

for x in people_list:
  if(x == 0):
    num += 1
    
print(num)

Solution (Python):
from collections import defaultdict
import sys

ip = lambda : sys.stdin.readline()
ipl = lambda : sys.stdin.readline().split()

n, k = map(int, ipl())
snukes = [0 for i in range(n+1)]
for i in range(k):
	d = int(ip())
	snuke = list(map(int, ipl()))
	for s in snuke:
		snukes[s] = 1
c = 0
for i in snukes[1:]:
	if not i:
		c += 1
print(c)

Solution (Python):
N, K = map(int, input().split())
L = []
for i in range(K):
	d = int(input())
	A = list(map(int, input().split()))
	for j in range(d):
			if not A[j] in L:
				L.append(A[j])
x = len(L)
print(N - x)

Solution (Python):
n, k = map(int, input().split())

se = set()

for i in range(k):
    a = input()
    li = list(map(int, input().split()))
    for j in range(len(li)):
        se.add(li[j])
print(n-len(se))

Solution (Python):
N, K = map(int, input().split())

have_snack = [0 for i in range(N)]

for k in range(K):
    hito_len = int(input())
    have_hito = list(map(int, input().split()))
    for hh in have_hito:
        have_snack[hh - 1] = 1

print(have_snack.count(0))

Solution (Python):
n, k = map(int,input().split())
sn = [0 for x in range(n)]
for kind in range(k):
    d = int(input())
    a_lis = list(map(int,input().split()))
    for a in a_lis:
        sn[a-1] += 1
print(sn.count(0))

Solution (Python):
n,k=map(int,input().split())
cnt=[0]*(n)
for i in range(k):
  d=int(input())
  kou=list(map(int,input().split()))
  for j in kou:
    cnt[j-1]=1
print(cnt.count(0))

Solution (Python):
n,k= list(map(int,input().split()))
t=list()
for i in range (k):
  d = int(input())
  A = list(map(int,input().split()))
  for a in A:
    t.append(a)
 
L = len(set(t))
print(n-L)

Solution (Python):
n,k = map(int,input().split())
se = set()
for i in range(k):
    d = int(input())
    a = [int(i) for i in input().split()]
    for A in a:
        se.add(A)
print(n-len(se))

Solution (Python):
N, K = map(int, input().split(' '))
count = [0 for i in range(N)]

for _ in range(K):
    d = int(input())
    A = list(map(int, input().split(' ')))
    for a in A:
        count[a - 1] += 1

ans = sum([c == 0 for c in count])
print(ans)

Solution (Python):
def main():
    N, K = map(int, input().split())

    having_candy = [False for _ in range(N)]

    for i in range(K):
        _ = input()
        ds = map(int, input().split())

        for s in ds:
            having_candy[s-1] = True

    print(N - sum(having_candy))


if __name__ == "__main__":
    main()

Solution (Python):
n,k = map(int,input().split(" "))
d = []
a = []
get_flag = [0 for i in range(n)]
for i in range(k):
    d.append(int(input()))
    a.append(list(map(int,input().split())))



for i in range(k):
    for j in range(d[i]):
        for m in range(n):
            if a[i][j] == m+1:
                get_flag[m] = 1

count = 0
for i in range(len(get_flag)):
    if get_flag[i] == 0:
        count += 1
print(count)

Solution (Python):
N, K = map(int, input().split())

d = []
A_set = set()

for i in range(K):
  d_i = int(input())
  A = list(map(int, input().split()))
  for j in A:
    A_set.add(j)

print(N - len(A_set))

Solution (Python):
n, k = map(int, input().split())
p_list = [i+1 for i in range(n)]
for i in range(k):
    d = int(input())
    a = list(map(int, input().split()))
    for p in a:
        if p in p_list:
            p_list.remove(p)

print(len(p_list))

Solution (Python):
n,k=map(int,input().split())
LI=list(range(1,n+1))
kari=n+1
for i in range(1,k+1):
  d=int(input())
  li=list(map(int,input().split()))
  for x in range(1,n+1):
    if li.count(x)!=0:
      if LI.count(x)!=0:
        LI.remove(x)
print(len(LI))

Solution (Python):
n,k = map(int, input().split())
sunuke = [1] * n

for i in range(k):
    di = int(input())
    tmp =  map(int, input().split())
    for t in tmp:
        sunuke[t-1] = 0
print(sum(sunuke))

Solution (Python):
n, k = map(int, input().split())
d = []
a = []
for i in range(k):
    d.append(int(input()))
    a.append(list(map(int, input().split())))

aa = [0]*n

for j in a:
    for t in j:
        aa[t - 1] += 1

ans = 0

for z in aa:
    if z == 0:
        ans += 1
    else:
        ans += 0

print(ans)

Solution (Python):
N, K = map(int, input().split())

sunuke_dict = {}
for i in range(K):
    input()
    okashi_sunukes = map(int, input().split())
    for okashi_sunuke in okashi_sunukes:
        sunuke_dict[okashi_sunuke] = ''

print(N - len(sunuke_dict))

Solution (Python):
n,k=map(int,input().split())
d=[[] for i in range(k)]
dlist=[]
memb=[i+1 for i in range(n)]
for i in range(k):
    d[i]=int(input())
    dklist=list(map(int,input().split()))
    dlist.append(dklist)
    for j in dklist:
        if j in memb:
            memb.remove(j)
print(len(list(memb)))

Solution (Python):
N,K = map(int,input().split(' '))
checkList = [1]*N

for i in range(K):
    d = input()
    aList = map(int,input().split(' '))
    for j in aList:
        checkList[j-1] = 0

print(sum(checkList))

Solution (Python):
N,K = map(int, input().split(" "))
flag = [1 for i in range(N)]
for i in range(K):
  input()
  a = map(int, input().split(" "))
  for j in a:
    flag[j - 1] = 0
print(sum(flag))

Solution (Python):
n, k = map(int, input().strip().split())

rr = [0] * n

for i in range(k):
  d = map(int, input().strip().split())
  aa = map(int, input().strip().split())
  for a in aa:
    rr[a-1] += 1

print(sum(1 for r in rr if r == 0))

Solution (Python):


from typing import Iterable


def main() -> None:
    N, K = rmi()
    D, A = [], []
    for k in range(K):
        d = ri()
        D.append(d)
        A.append(rmi())
    target = [False] * N
    for k in range(K):
        for a in A[k]:
            target[a - 1] = True
    w(target.count(False))


def r() -> str:
    return input().strip()


def ri() -> int:
    return int(r())


def rmi(delim: str = ' ') -> int:
    return tuple(map(int, input().split(delim)))


def w(data) -> None:
    print(data)


def wm(data: Iterable) -> None:
    print(' '.join(data))


if __name__ == '__main__':
    main()

Solution (Python):
N, K = map(int, input().split())
G = 0
S = []

for i in range(K):
    G = int(input())
    S.extend(input().split())

print(N - len(set(S)))

Solution (Python):
N, K = map(int, input().split())
G = 0
S = []

for i in range(K):
    G += int(input())
    S.append(input().split())

A = []

for i in S:
    A.extend(i)

print(N - len(list(set(A))))

Solution (Python):
N, K = map(int, input().split())
sunuke_list = []
for i in range(K):
    input()
    sunuke_list += list(map(int, input().split()))

sunuke_set = set(sunuke_list)

print(len([x for x in range(1,N+1) if not(x in sunuke_set)]))

Solution (Python):
num_sunuke, num_okashi = map(int, input().split())

have_okashi_sunuke_dict = {}
for i in range(num_okashi):
    input()
    num_have_okashi_sunukes = map(int, input().split())
    for num_have_okashi_sunuke in num_have_okashi_sunukes:
        have_okashi_sunuke_dict[num_have_okashi_sunuke] = ''

print(num_sunuke - len(have_okashi_sunuke_dict))

Solution (Python):
s = list(map(int, input().split()))

sunuke = []
ans = 0
for n in range(s[0]):
  sunuke.append(0)
for n in range(s[1]):
  d = input()
  a = list(map(int, input().split()))
  for n2 in a:
    sunuke[n2-1] += 1
for n in sunuke:
  if n == 0:
    ans += 1
print(ans)

Solution (Python):
N, K = list(map(int,input().split()))
snuke = set([i+1 for i in range(N)])
for k in range(K):
    _ = input()
    L = list(map(int,input().split()))
    snuke = snuke - set(L)
print(len(snuke))

Solution (Python):
N, K = map(int, input().split())
A = []
for i in range(K) :
    d = int(input())
    a = list(map(int, input().split()))
    A += a
 
print(N - len(set(A)))

Solution (Python):
N,K=map(int,input().split())
A=[]

for _ in range(K):
    d=int(input())
    A.append(list(map(int,input().split()))) 
print(N-len(set(sum(A,[]))))

Solution (Python):
n,k = map(int, input().split())
flag = [1 for i in range(n)]
for _ in range(k):
  d = int(input())
  for a in map(int, input().split()):
      flag[a-1] = 0
print(sum(flag))

Solution (Python):
N, K = map(int, input().split())

d_list = []
A_list = []
for _ in range(K):
    d_list.append(int(input()))
    tmp = list(map(int, input().split()))
    for a in tmp:
        A_list.append(a)

A_set = set(A_list)
print(N - len(A_set))

Solution (Python):
N,K=map(int,input().split())
A=[]
for i in range(K):
    di=int(input())
    Ai=list(map(int,input().split()))
    A.extend(Ai)
L=list(range(1,N+1))
count=0
for i in L:
    if A.count(i)==0:
        count=count+1
    else:
        continue
print(count)

Solution (Python):



N, K = map(int, input().split())
A = []
S = list(range(1,N+1))
for i in range(K):
    tmp_d = int(input())
    tmp_A = list(map(int, input().split()))
    A.extend(tmp_A)

unique_A = set(A)
for i in unique_A:
    S.remove(i)

print(len(S))

Solution (Python):
v = list(map(int, input().split()))
n = v[0]
k = v[1]

ls = [0] * n
for i in range(k):
    okasi = int(input())
    p = list(map(int, input().split()))
    for j in p:
        ls[j-1] += 1

sum = 0
for i in range(n):
    if ls[i] == 0:
        sum += 1

print(sum)

Solution (Python):
N, K = list(map(int, input().split()))
record = [0 for i in range(N)]
grid = []
for i in range(2*K):
    array = list(map(int, input().split()))
    grid.append(array)

for i in range(K):
    for j in range(grid[i * 2][0]):
        record[grid[i * 2 + 1][j]-1] = 1

flag = 0
for i in range(N):
    if record[i] == 0:
        flag += 1
print(flag)

Solution (Python):
N,K=map(int,input().split())
A=set()
for _ in range(K):
    d=int(input())
    A=A.union(set(map(int,input().split())))
print(N-len(A))

Solution (Python):
n, k = [int(x) for x in input().split()]
a = []
has = set()
for _ in range(k):
    d = int(input())
    a.append({int(x) for x in input().split()})
    assert d == len(a[-1])
    has |= a[-1]
print(n - len(has))

Solution (Python):
N, K = map(int, input().split())
A = []
for i in range(K) :
    d = int(input())
    a = list(map(int, input().split()))
    A += a

print(N - len(set(A)))

Solution (Python):
n, k = [int(i) for i in input().split()]
sunuke = [0] * n
for i in range(k):
  _ = int(input())
  for j in input().split():
    sunuke[int(j)-1] += 1
print(sunuke.count(0))

Solution (Python):
N, K = map(int, input().split())
A = [0] * N
for _ in range(K):
    d = int(input())
    for i in map(int, input().split()):
        A[i - 1] = 1
print(A.count(0))

Solution (Python):
def main():
    n, k = map(int, input().split())
    s = []
    ans_temp = [i for i in range(1, n+1)]
    for _ in range(k):
        d = int(input())
        As = map(int, input().split())
        s.extend(As)
    ans = len(set(ans_temp)) - len(set(s))
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
N, K = map(int, input().split(" "))
flag = [1 for i in range(N)]
for i in range(K):
  input()
  for j in map(int,input().split(" ")):
    flag[j-1] = 0
print(sum(flag))

Solution (Python):
from collections import defaultdict
N,K = map(int,input().split())

d_snack =defaultdict(int)

for i in range(0,K):
    d = int(input())
    A = list(map(int,input().split()))
    
    for j in range(0,len(A)):
        
        d_snack[A[j]] = d_snack[str(A[j])] +1
    
count=0
for i in range(0,N):
    
    if d_snack[i+1]==0:
        count +=1
print(count)

Solution (Python):
def i():
    return int(input())
def i2():
    return map(int,input().split())
def s():
    return str(input())
def l():
    return list(input())
def intl():
    return list(int(k) for k in input().split())

n,k=i2()
D=[]
A=[]
for j in range(k):
	d=i()
	a=intl()
	D.append(d)
	A.append(a)
s=[]
for i in range(k):
	for j in range(0,D[i]):
		s.append(A[i][j])
s=set(s)
print(n-len(s))

Solution (Python):
n, k = map(int, input().split())
a = []

for i in range(k):
    d = int(input())
    ai = list(map(int, input().split()))
    a = a + ai

print(n-len(set(a)))

Solution (Python):
N, K = map(int, input().split(" "))
flag = [1 for i in range(N)]
for i in range(K):
  input()  
  for j in map(int, input().split(" ")):
    flag[j - 1] = 0
print(sum(flag))

Solution (Python):
import os
import sys
from io import BytesIO, IOBase


def solution():
    pass


def main():
    n, k = r_array()
    res = [0] * n
    for _ in range(k):
        d = r_int()
        darr = r_array()
        for x in darr:
            res[x - 1] += 1

    write(sum(u == 0 for u in res))




BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)


def input():
    return sys.stdin.readline().rstrip("\r\n")


def write(*args, end='\n'):
    for x in args[:-1]:
        sys.stdout.write(str(x) + ' ')
    sys.stdout.write(str(args[-1]))
    sys.stdout.write(end)


def r_array():
    return [int(x) for x in input().split()]


def r_int():
    return int(input())


if __name__ == "__main__":
    main()

Solution (Python):
n,k=map(int,input().split())
sunuke=[0]*n
for i in range(k):
    d=int(input())
    a=list(map(int,input().split()))
    for j in a:
        sunuke[j-1]+=1
print(sunuke.count(0))

Solution (Python):
n, k = map(int, input().split())
li = [True] * n
for i in range(k):
    d = int(input())
    a_list = list(map(int, input().split()))
    for a in a_list:
        li[a - 1] = False
print(sum(li))

Solution (Python):
Row = list(map(int, input().split()))


List = [list(map(int, input().split())) for i in range(Row[1]*2)]

sunuke = [0]*Row[0]

for i in range(1, len(List), 2):
  
  for j in List[i]:
    sunuke[j-1] += 1

count = 0
for i in range(len(sunuke)):
     if( sunuke[i] == 0):
               count+=1
print(count)

Solution (Python):
n, k = map(int, input().split())
d = []
a = []
sunuke = [int(i)+1 for i in range(n)]

for i in range(k):
  d.append(int(input()))
  for i in input().split():
    a.append(int(i))

ans = 0

for i in sunuke:
  if i not in a:
    ans += 1

print(ans)

Solution (Python):
import sys
readline = sys.stdin.readline

N,K = map(int,readline().split())

ans = set(range(1,N+1))
for i in range(K):
  d = int(readline())
  ans -= set(map(int,readline().split()))
  
print(len(ans))

Solution (Python):
n, k = map(int, input().split())
A = [0] * n



for i in range(k):
    di = int(input())
    Ai = list(map(int, input().split()))

    for j in range(di):
        A[Ai[j] - 1] += 1



ans = 0
for i in range(n):
    if A[i] == 0:
        ans += 1

print(ans)

Solution (Python):
n, k = map(int, input().split())
A = []
for i in range(k):
  d = int(input())
  a = list(map(int, input().split()))
  A = A + a

print(n-len(set(A)))

Solution (Python):
N, K = map(int, input().split())
N_array = [0] * N
for i in range(K):
    d = int(input())
    A_array = list(map(int, input().split()))
    for j in range(len(A_array)):
        N_array[A_array[j]-1] += 1

print(N_array.count(0))

Solution (Python):
N,K = (int(x) for x in input().split())
all = set(map(lambda a: a+1,range(N)))
for i in range(K):
	d = input()
	Ai = set(int(x) for x in input().split())
	all -= Ai
	
print(len(all))

Solution (Python):
import sys
readline = sys.stdin.readline

N,K = map(int,readline().split())

ans = set(range(1,N+1))
for i in range(K):
  d = int(input())
  A = list(map(int,readline().split()))
  ans -= set(A)
  
print(len(ans))

Solution (Python):
N, K = map(int, input().split())
D = []
A = [[] for i in range(200)]
for i in range(K):
    d = int(input())
    D.append(d)
    a = list(map(int, input().split()))
    A[i] = a

ans = 0
for i in range(1, N+1):
    num = 0
    for j in range(K):
        for k in range(D[j]):
            if A[j][k] == i:
                num = 1
    if num == 0:
        ans += 1
print(ans)

Solution (Python):
n, k = [int(x) for x in input().split()]
l = []
for i in range(k):
    d = input()
    l.extend(list(map(int, input().split())))
s = set(l)
print(n -len(s))

Solution (Python):
from sys import stdin, stdout
rl = lambda: stdin.readline()
rll = lambda: stdin.readline().split()

def main():
	n, k = (int(x) for x in rll())
	exclude = set()
	for _ in range(k):
		d = int(rl())
		for snuke in (int(x) for x in rll()):
			exclude.add(snuke)
	ans = n - len(exclude)
	stdout.write(str(ans));stdout.write("\n")
	stdout.close()

if __name__ == "__main__":
	main()

Solution (Python):
n,k = list(map(int,input().split()))
l = [0]*n
for i in range(k):
    x = int(input())
    y = list(map(int,input().split()))
    for j in range(x):
        l[y[j]-1] = 1

print(n-sum(l))

Solution (Python):
n, k = map(int, input().split())
list = []
for p in range(k):
  d = int(input())
  k_list = [int(x) for x in input().split()]
  m = len(k_list)
  for q in k_list:
    if not q in list:
      list.append(q)
l = len(list)
print(n - l)

Solution (Python):
N, K = list(map(int, input().split()))
okashi = [False] * N
for i in range(K):
    d = int(input())
    a = list(map(int, input().split()))
    for ai in a:
        okashi[ai-1] = True

ans = okashi.count(False)
print(ans)

Solution (Python):
N,K=map(int,input().split())
A=[]
B=[0]*N
ans=0
for i in range(K):
    input()
    A=list(map(int,input().split()))
    for j in A:
        B[j-1]=1
for i in B:
    if i==0:
        ans+=1
print(ans)

Solution (Python):
n,k = map(int,input().split())
a = set([i+1 for i in range(n)])
b = set()
for i in range(k):
  d = input()
  b |= set(map(int,input().split()))
print(len(a^b))

Solution (Python):
n,k = map(int,input().split())
s = [i+1 for i in range(n)]
a = []
for i in range(k):
  d = int(input())
  a = list(map(int,input().split()))
  for i in a:
    if i in s:
      s.remove(i)
print(len(s))

Solution (Python):
N,K=map(int, input().split())
P_list=[]
for i in range(K):
    d=int(input())
    P_list.extend(list(map(int, input().split())))
print(N-len(set(P_list)))

Solution (Python):
n,k=map(int,input().split())
s=set()
for i in range(k):
    d=int(input())
    a=set(map(int,input().split()))
    s=s|a
ans=n-len(s)
print(ans)

Solution (Python):
N,K=input().split()
def delete(a,n):
  j=len(a)
  for i in range(j):
    n=[l for l in n if l!=int(a[i])]
    
  return n

def get(y):
  first=[]
  for i in range(y):
    first.append(i+1)
    
  return first

answer=get(int(N))
for i in range(int(K)):
  v=input()
  b=input().split()
  answer=delete(b,answer)
  
print(len(answer))

Solution (Python):
n, k = map(int, input().split())

workList = [1] * n

for i in range(k):
    input()
    *inList, = map(int, input().split())
    for di in inList:
        workList[int(di)-1] = 0

print(sum(workList))

Solution (Python):
inList = input().split()
n = int(inList[0])
k = int(inList[1])

workList = [1] * n

for i in range(k):
    di = int(input())
    inList = input().split()
    for di in inList:
        workList[int(di)-1] = 0


print(sum(workList))

Solution (Python):
N,K = map(int,input().split())

O = [0]*N

for k in range(K):
    d = int(input())
    A = [int(i) for i in input().split()]
    for a in A:
        O[a-1]+=1
print(O.count(0))

Solution (Python):
def input_map_int():
    return map(int,input().split())

n,k=input_map_int()

flag=[True]*n

for i in range(k):
    d=int(input())
    a=list(input_map_int())
    for j in a:
        flag[j-1]=False

print(flag.count(True))

Solution (Python):
N,K = map(int,input().split())

M = [0] * N

for i in range(K) :
    C = int(input())
    L = list(map(int,input().split()))
    for j in range(C) :
        M[L[j] - 1] += 1
R = 0
for i in range(N) :
    if M[i] == 0 :
        R += 1

print(R)

Solution (Python):
n, k = map(int, input().split())
X = [True for i in range(n)]
for j in range(k):
    input()
    *A, = map(int, input().split())
    for a in A:
        X[a - 1] = False
print(len([x for x in X if x]))

Solution (Python):
n,k = map(int,input().split())
a = set()
for _ in range(k):
    d = int(input())
    a |= set(input().split())
print(n-len(a))

Solution (Python):
from sys import stdin
N, K = [int(_) for _ in stdin.readline().rstrip().split()]
D = []
A = []
for i in range(K):
  d = int(stdin.readline().rstrip())
  D.append(d)
  a = [int(_) for _ in stdin.readline().rstrip().split()]
  for _a in a:
    A.append(_a)
A = set(A)
print(N-len(list(A)))

Solution (Python):
N, K = map(int, input().split())

snuke = [0] * N


for i in range(K):
    d = int(input()) 

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

    for j in range(d):
        snuke[A[j] - 1] = 1

ans = 0

for i in range(N):
    if snuke[i] == 0:
        ans += 1

print(ans)

Solution (Python):

n,k=map(int,input().split())
l=[]
n_l=[]
for i in range(1,n+1):
    n_l.append(i)

for i in range(k):
    d = int(input())
    a = list(map(int,input().split()))
    for a_j in a:
        l.append(a_j)
l=list(set(l))    

ans=len(list(set(n_l)-set(l)))
print(ans)

Solution (Python):
init=input().split()
num=int(init[0])
snacks=int(init[1])
check=[]
 
for i in range(snacks):
  sNum=int(input())
  if sNum>1:
    whos=input().split()
    for j in range(sNum):
      check.append(whos[j])
  else:
    who=input()
    check.append(who)
   
count=0
for i in range(1,num+1):
  if str(i) not in check:
    count=count+1
print(count)

Solution (Python):
def l(): return [int(a) for a in input().split(" ")] 
ka = l()
lis = [a + 1 for a in range(ka[0])]
for a in range(ka[1]):
  input()
  q = l()
  for b in q:
    if b in lis:
      lis.pop(lis.index(b))
print(len(lis))

Solution (Python):
N, K = map(int, input().split())
D = [0] * K
A = [None] * K

for k in range(K):
    D[k] = int(input())
    A[k] = list(map(int, input().split()))

snuke = [0] * N

for k in range(K):
    for d in range(D[k]):
        snuke[A[k][d] - 1] += 1

ans = snuke.count(0)

print(ans)

Solution (Python):
N, K = map(int, input().split())
d = []
A = []
for _ in range(K):
    d.append(int(input()))
    A.append(list(map(int, input().split())))

nusuke = [1 for _ in range(N)]

for kids in A:
    for kid in kids:
        nusuke[kid-1] = 0

itazura = nusuke.count(1)
print(itazura)

Solution (Python):

N, K = map(int, input().split())
nonset = []
for i in range(K):
    _ = input()
    arr = list(map(int, input().split()))
    nonset.extend(arr)
print(N - len(set(nonset)))

Solution (Python):
N, K = (int(i) for i in input().split())

flag = [True]*N
for k in range(K):
  tmp = input()
  for i in list(map(int,input().split())):
        flag[i-1] = False
 
print(sum(1 for x in flag if x==True))

Solution (Python):
N,K = map(int, input().split())
my_list = [0] * N
for i in range(K):
    d = int(input())
    d_list = list(map(int, input().split()))
    for n in d_list:
        my_list[n - 1] += 1

print(my_list.count(0))

Solution (Python):
import sys
import math
n, k = map(int, input().split())
ans=[False]*n
for i in range(k):
    tmp = int(input())
    li = list(map(int, input().split()))
    for j in li:
        if (ans[j - 1] == False):
            ans[j - 1] = True
cnt = 0
for i in ans:
    if not i:
        cnt += 1
print(cnt)

Solution (Python):
def q2():
    N, K = (int(i) for i in input().split())
    ans = [True]*N

    for i in range(K):
        d = int(input())
        A = [int(i) for i in input().split()]
        for a in A:
            ans[a-1] = False

    print(ans.count(True))


if __name__ == '__main__':
    q2()

Solution (Python):
N,K=map(int,input().split())
A=[int(i) for i in range(1,N+1,1)]

for _ in range(K):
    d=int(input())
    A_lis=list(map(int,input().split()))
    
    for i in A_lis:
        if i in A: A.remove(i)
print(len(A))

Solution (Python):
n,k = map(int,input().split())
list = []
for i in range(k):
    d = input()
    list.append(input().split())
cnt = 0
for i in range(n):
    a = str(i + 1)
    flg = False
    for l2 in list:
        if a in l2:
            flg = True
            break
    if not flg:
        cnt += 1

print(cnt)

Solution (Python):
N, K = map(int, input().split())

h = set()
for d in range(K):
    _ = input()
    for a in map(int, input().split()):
        h.add(a)

result = set(range(1, N + 1)) - h
print(len(result))

Solution (Python):
n, k = [int(x) for x in input().split()]
l = [0] * n
for i in range(k):
    d = int(input())
    for j in list(map(int,input().split())):
        l[j-1] = 1
print(l.count(0))

Solution (Python):
n,k=map(int,input().split())
m=[]
for i in range(k):
  d=int(input())
  a=list(map(int,input().split()))
  for p in a:
    m.append(p)
j=set(m)
print(n-len(j))

Solution (Python):
n, k = map(int, input().split())
a = [0] * n
for i in range(k):
    d = int(input())
    have_snack =  list(map(int, input().split()))
    for i in have_snack:
        a[i - 1] += 1
        
print(a.count(0))

Solution (Python):

N, K = map(int, input().split())

d = []
A = []
for i in range(K):
    dn = int(input())
    An = list(map(int, input().split()))
    d.append(dn)
    A.append(An)

check = []
for a in A:
    check = list(set(check + a))

print(N - len(check))

Solution (Python):
n,k=map(int,input().split())
ans=set([i for i in range(1,n+1)])

for i in range(k):
    d=int(input())
    a=set(list(map(int,input().split())))
    ans=ans - a
print(len(ans))

Solution (Python):
SUNUKE,KASHI  =list(map(int, input().split()))
havings = [1 for _ in range(SUNUKE)]

for k in range(KASHI):
    num_sunuke=int(input())
    having_sunuke = list(map(int, input().split()))
    for i in having_sunuke:
        havings[i-1] = 0


print(sum(havings))

Solution (Python):
N, K = map(int, input().split())
lis = [0 for i in range(N)]

for turn in range(K):
  nn = int(input())
  li = list(map(int,input().split()))
  for num in li:
    lis[num-1] = 1

print (lis.count(0))