program main
    implicit none
    integer n, k, d
    integer, allocatable, dimension(:) :: a,p
    integer i,j,sum

    read(*,*) n, k
    allocate(p(n))
    do i = 1,n
        p(i) = 1
    end do

    do i = 1,k
        read(*,*) d
        allocate(a(d))
        read(*,*) a
        do j = 1, d
            p(a(j)) = 0
        end do
        deallocate(a)
    end do

    sum = 0
    do i = 1,n
        sum = sum + p(i)
    end do
    write(*,*) sum


end program