object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n, k = sc.nextInt
  var snk = (1 to n).toSet

  for (_ <- 1 to k) {
    snk = snk -- Set.fill(sc.nextInt)(sc.nextInt)
  }

  println(snk.size)
}
