program bm
implicit none
integer::N
integer::K
integer::d
integer,allocatable,dimension(:)::A
logical,allocatable,dimension(:)::SUNUKE
integer::ans=0

integer::i,j
read*,N,K
allocate(SUNUKE(N))
SUNUKE=.true.
do i=1,K
    read*,d
    allocate(A(d))
    read*,A
    do j=1,d
        SUNUKE(A(j))=.false.
    end do
    deallocate(A)
end do
do i=1,N
    if(SUNUKE(i))ans=ans+1
end do
print"(I0)",ans
end program bm