program main
implicit none
integer :: n,k,d,ans = 0
integer,allocatable :: a(:),sn(:)

read(*,*)n,k
allocate(a(n),sn(n))
sn = 0
a = 0

do i = 1,k
read(*,*)d
read(*,*)a(1:d)
do j = 1,d
if (sn(a(j)) == 0) ans = ans + 1
sn(a(j)) = 1
end do
end do

write(*,*) n - ans
end program main