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

d_list = []

a_list = []



for i in range(k):

    d_list.append(int(eval(input())))

    a_list.append(list(map(int, input().split())))

nonhave_list = []



for j in range(n):

    for l in range(k):

        exist = False

        if j+1 in a_list[l]:

            exist = True

            break

    if not exist:

        nonhave_list.append(j)



print((len(nonhave_list)))



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

d_list, a_list = [], []

ans_list = [1] * n



for i in range(k):

    d_list.append(int(eval(input())))

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

    for j in a_list:

        if ans_list[j-1] == 1:

            ans_list[j-1] = 0

print((sum(ans_list)))

n, k = list(map(int, input().split()))
d_list = []
a_list = []
for i in range(k):
    d_list.append(int(eval(input())))
    a_list.append(list(map(int, input().split())))
nonhave_list = []
for j in range(n):
    for l in range(k):
        exist = False
        if j + 1 in a_list[l]:
            exist = True
            break
    if not exist:
        nonhave_list.append(j)
print((len(nonhave_list)))

n, k = list(map(int, input().split()))
d_list, a_list = [], []
ans_list = [1] * n
for i in range(k):
    d_list.append(int(eval(input())))
    a_list = list(map(int, input().split()))
    for j in a_list:
        if ans_list[j - 1] == 1:
            ans_list[j - 1] = 0
print((sum(ans_list)))

-d_list = [] -a_list = [] +d_list, a_list = [], [] +ans_list = [1] * n -    a_list.append(list(map(int, input().split()))) -nonhave_list = [] -for j in range(n): -    for l in range(k): -        exist = False -        if j + 1 in a_list[l]: -            exist = True -            break -    if not exist: -        nonhave_list.append(j) -print((len(nonhave_list))) +    a_list = list(map(int, input().split())) +    for j in a_list: +        if ans_list[j - 1] == 1: +            ans_list[j - 1] = 0 +print((sum(ans_list)))