object Main extends App{
  val Array(n,k) = scala.io.StdIn.readLine.split(" ").map(_.toInt)
  val inputs = for(count <- 1 to 2*k) yield scala.io.StdIn.readLine
  val As = (2 to 2*k by 2).map(e => inputs(e-1)).map(e1 => e1.split(" ").map(_.toInt).toList).reduce(_ ::: _)
  val nothave = (1 to n).toSet.diff(As.distinct.toSet)
  println(nothave.toSeq.size)
}
