program sample
implicit none

integer :: n, k
integer, allocatable :: a(:), b(:)
integer :: d
integer :: number

integer :: i, j

read(*,*) n, k
allocate(a(n))
a = 0
do i = 1, k
read(*,*) d
allocate(b(d))
read(*,*) b
do j = 1, d
a(b(j)) = 1
end do
deallocate(b)
end do

number = 0

do i = 1, n
if (a(i) == 0) then
number = number + 1
end if
end do

write(*,*) number

stop
end program sample