program name
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int32):: n,k,i,j,ans
    logical,allocatable:: h(:)

    read*, n,k
    allocate(h(n))
    h(:) = .false.

    do i=1,k
        block
            integer(int32):: d
            integer(int32), allocatable:: a(:)

            read*, d
            allocate(a(d))
            read*, a(:)
            do j=1,d
                h(a(j)) = .true.
            end do
        end block
    end do

    ans=0
    do i=1,n
        if (.not.h(i)) ans=ans+1
    end do
    print'(i0)', ans
end program name