program trick
  
  implicit none
  integer :: n,k,i,j,m,answer
  integer,allocatable :: d(:),a(:,:),ans(:)
  

  read*,n,k
  !print*,n,k
  allocate(d(k))
  allocate(ans(n))
  ans=0 
 
  do i=1,k
   read*, d(i)
   !print*,d(i)
   allocate(a(1:k,1:d(i)))
    
     read*, a(i,1:d(i))
     !print*, a(i,1:d(i))
     
      do j=1,d(i)
       do m=1,n
        if(a(i,j)==m) ans(m)=ans(m)+1
       end do
      end do
    
   deallocate(a)
  end do

  answer=0
  do i=1,n
   if(ans(i)==0) answer=answer+1
  end do

 print*,answer

 

end program trick