object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n, m = sc.nextInt
  val h = Seq.fill(n)(sc.nextInt)

  var good_t = (1 to n).toSet

  for (_ <- 1 to m) {
    val a, b = sc.nextInt

    if (h(a - 1) >= h(b - 1)) {
      good_t = good_t - b
    } else {
      good_t = good_t - a
    }
  }

  print(good_t.size)
}
