program trick_or_treat
  implicit none
  integer :: n, k, d, a(100) = 0, c(100) = 1, i, j
  read(*,*) n, k
  do i = 1, k
    read(*,*) d
    read(*,*) a(1:d)
    do j = 1, d
      c(a(j)) = c(a(j))-1
    end do
  end do
  write(*,'(i0)') sum(c(1:n),c(1:n) > 0)
end program trick_or_treat