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