let () = Scanf.scanf "%d %d\n" @@ fun n k ->
  let snuke = Array.make n 1 in
  for i=1 to k do
    Scanf.scanf "%d\n" @@ fun d ->
    for j=1 to d do
      if j<d
      then Scanf.scanf " %d" @@ fun d -> snuke.(d-1) <- 0
      else Scanf.scanf " %d\n" @@ fun d -> snuke.(d-1) <- 0
    done
  done;
  Printf.printf "%d\n" @@
  Array.fold_right (+) snuke 0