import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)
  val N, K = sc.nextInt()
  val A = Set.fill(K) {
    val d = sc.nextInt()
    Set.fill(d)(sc.nextInt())
  }

  val x = (1 to N).toSet -- A.flatten

  println(x.size)
}