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):
def Int():
    return int(input())
def Ints():
    return map(int,input().split())
def IntList():
    return list(Ints())
def IntMat(N):
    return [IntList() for i in range(N)]

N,K = Ints()
Have = [0]*N

for i in range(K):
    d = Int()
    A = IntList()
    for j in A:
        Have[j-1]+=1
ans = 0

for i in Have:
    if i==0:
        ans += 1
print(ans)

Solution (Python):
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import random
import re
import string
import sys
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from functools import lru_cache, reduce
from math import gcd
from operator import add, itemgetter, mul, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7


N, K = list(map(int, sys.stdin.buffer.readline().split()))


cnt = [0] * (N + 1)
for _ in range(K):
    d = int(sys.stdin.buffer.readline())
    A = list(map(int, sys.stdin.buffer.readline().split()))
    for a in A:
        cnt[a] += 1
ans = cnt.count(0) - 1
print(ans)

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

buf = [0 for i in range(n)]
for i in range(k):
    d=int(input())
    arr = list(map(int,input().split()))

    for a in arr:
        buf[a-1] += 1

ans = 0
for b in buf:
    if b==0:
        ans += 1
print(ans)

Solution (Python):
n, k = map(int, input().split())
sunukes = set(range(1, n + 1))
for _ in range(k):
    d = int(input())
    sunukes.difference_update(map(int, input().split()))
print(len(sunukes))

Solution (Python):
import math,itertools,fractions,heapq,collections,bisect,sys,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  n,k=LI()
  l=[0]*n

  for _ in range(k):
    d=I()
    a=LI()
    for x in a:
      l[x-1]+=1

  return l.count(0)


print(main())

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

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

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

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

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

Solution (Python):
import sys
input = sys.stdin.readline
from collections import *

N, K = map(int, input().split())
cnt = [0]*N

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

ans = cnt.count(0)
print(ans)

Solution (Python):











import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log 
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N,K=MI()
    have = set()
    for i in range(K):
        _ = I()
        for x in LI():
            have.add(x)
    print(N-len(have))
if __name__ == '__main__':
    main()

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

ans = [0]*n

for i in range(k):
    d = int(input())
    a = [int(x) for x in input().split()]
    for x in a:
        ans[x-1] += 1

print(ans.count(0))

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 i in a:
        sunuke[i-1] += 1
ans = sunuke.count(0)
print(ans)

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

flag = [1]*N

for i in range(K):
    d = int(input())
    A = list(map(int,input().split()))
    for a in A:
        flag[a-1] = 0

print(sum(flag))

Solution (Python):
n, k = map(int, input().split())
C = [1]*n
for _ in range(k):
    d = int(input())
    A = list(map(int, input().split()))
    for a in A:
        C[a-1] = 0
ans = sum(C)
print(ans)

Solution (Python):

import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n,k = map(int,input().split())
data = [0] * n
for i in range(k):
  d = int(input())
  A = list(map(int,input().split()))
  for ai in A:
    ai-=1
    data[ai] += 1
for di in data:
  if di == 0:
    ans += 1
print(ans)

Solution (Python):
N,K=map(int,input().split())
SET=set()
for i in range(K):
    d=map(int,input().split())
    SET|=set(map(int,input().split()))
print(N-len(SET))

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

def main():
    N, K = map(int, readline().rstrip().split())
    S = [0] * N
    for _ in range(K):
        d = int(readline())
        A = list(map(int, readline().rstrip().split()))
        for a in A:
            S[a-1] += 1
    
    print(len([s for s in S if s == 0]))


if __name__ == '__main__':
    main()

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n,k = inpl()
s = set()
for i in range(k):
    a = inp()
    b = inpl()
    for i in b:
        s.add(i)
print(n-len(s))

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


main()

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

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

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

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(2 * 10**6)


def inpl():
    return list(map(int, input().split()))


def main():
    N, K = inpl()
    D = []
    As = []
    for _ in range(K):
        D.append(int(input()))
        As.append(inpl())
    ans = [0] * (N + 1)
    ans[0] = 1
    for A in As:
        for a in A:
            ans[a] += 1
    print(ans.count(0))
    return


if __name__ == '__main__':
    main()

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10, gcd
from itertools import permutations, combinations, product, accumulate, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 1, 0, -1, 1, -1, -1, 1]
dy = [1, 0, -1, 0, 1, -1, 1, -1]
debugmode = True

n, k = MAP()
arr = [1 for _ in range(n)]
for i in range(k):
    d = INT()
    a = LIST()
    for j in a:
        arr[j - 1] = 0
print(sum(arr))

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

Solution (Python):
n,k=map(int,input().split())
cnt=[0]*(n+1)
for _ in range(k):
  tmp=int(input())
  arr=list(map(int,input().split()))
  for val in arr:
    cnt[val]+=1
ans=0
for i in range(1,n+1):
  if cnt[i]==0:
    ans+=1
print(ans)

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

Solution (Python):
def main():
    n, k = map(int, input().split())
    s = [0 for _ in range(n)]
    for _ in range(k):
        d = int(input())
        a = list(map(int, input().split()))
        for aa in a:
            s[aa - 1] += 1
    ans = 0
    for ss in s:
        if ss == 0:
            ans += 1
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
def main():
    N, K = list(map(int, input().split()))
    S = [0] * N
    for _ in range(K):
        input()
        for i in list(map(int, input().split())):
            S[i - 1] += 1
    return S.count(0)

print(main())

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

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

for i in range(k):
    d = int(input())
    a = list(map(int,input().split()))
    for j in a:
        has[j - 1] = True
print(has.count(False))

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))

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

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