program ABC166_B
  integer,allocatable::A(:,:),d(:),s(:)
  read(*,*)N,K
  allocate(A(K,N),d(K),s(N))
  s=1
  A=0
  do i=1,K
     read(*,*)d(i)
     read(*,*)A(i,1:d(i))
     do j=1,d(i)
        do k=1,N
           if(A(i,j)==k) then
              s(k)=0
              exit
           end if
        end do
     end do
  end do
  write(*,*)sum(s)
end program ABC166_B