program problemB
  implicit none


integer(8) :: n,k,l
integer(8) :: BNUM, RNUM, NMAX, count,MMAX, sum, B, multi,countA,countC,KMAX
integer(8) :: money, yr
integer(8), allocatable :: d(:), a(:,:), c(:)
character(len=4) :: color



read(*,*) NMAX,KMAX

allocate(d(KMAX),a(KMAX,NMAX),c(NMAX))
a(:,:)=0

do k=1, KMAX
  read(*,*) d(k)
  read(*,*) a(k,1:d(k))
end do

c(:)=1

do n=1, NMAX
  do k=1, KMAX
    do l=1,d(k)
      if (n==a(k,l)) then
        c(n)=0
      end if
    end do
  end do
end do

  write(*,*) sum(c)




deallocate(d,a,c)

stop
end program
