(n,_),*t=[t.split()for t in open(0)][::2]

print((int(n)-len(set(sum(t,[])))))
n,_,*t=''.join([*open(0)][::2]).split()

print((int(n)-len({*t})))
(n, _), *t = [t.split() for t in open(0)][::2]
print((int(n) - len(set(sum(t, [])))))

n, _, *t = "".join([*open(0)][::2]).split()
print((int(n) - len({*t})))

-(n, _), *t = [t.split() for t in open(0)][::2] -print((int(n) - len(set(sum(t, []))))) +n, _, *t = "".join([*open(0)][::2]).split() +print((int(n) - len({*t})))