let check_trick array size =
  let rec loop i cnt =
    if i >= size
    then cnt
    else
      if array.(i) = false
      then loop (i+1) (cnt+1)
      else loop (i+1) cnt
  in loop 0 0

let () = Scanf.scanf "%d %d\n" @@ fun n k ->
  let snuke = Array.make n false in
  let multi_input () = Scanf.scanf "%d\n" @@ fun d ->
    for i=0 to d-1 do
      if i<d-1
      then Scanf.scanf " %d" @@ fun id -> snuke.(id-1) <- true
      else Scanf.scanf " %d\n" @@ fun id -> snuke.(id-1) <- true
    done in
  let solve () =
    for i=1 to k do
      multi_input ()
    done;
    check_trick snuke n
  in Printf.printf "%d\n" @@ solve ()