      PROGRAM TrickORtreat
      IMPLICIT NONE
      integer :: n,k
      integer :: a(100)
      logical :: sunukeByCandy(100,100) = .true.
      integer :: i,j,d,ans
      
      
      
      read*,n,k
      
      do i = 1,k
        read*,d
        read*,a(1:d)
        
        do j = 1,d
          sunukeByCandy(a(j),i) = .false.
        end do
      end do
      
      ans = 0
      do j = 1,n
        if( all(sunukeByCandy(j,1:k)) )then
          ans = ans + 1
        end if
      end do
      
      print*,ans
    !  do i = 1,n
    !    print*,sunukeByCandy(i,1:k)
    !  end do
      
      END PROGRAM