import java.util.Scanner

import scala.io.StdIn._
object Main extends App {

  val Array(n, k) = scala.io.StdIn.readLine().split(" ").map(_.toInt)
  val sweets = Array.fill(k * 2)(readLine().split(" ").map(_.toInt))
    .zipWithIndex.collect {
    case (list, index) if index % 2 == 1 => list.map(_ - 1)
  }


  def solve() = {
    val hasSweetArr = Array.fill(n)(false)
    sweets.foreach { list =>
      list.foreach { i =>
        if(!hasSweetArr(i)) hasSweetArr(i) = true
      }
    }
    hasSweetArr.count(!_)
  }

  println(solve())

}

