import scala.collection.mutable

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 bad_t = mutable.Set.empty[Int]

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

    if (h(a - 1) > h(b - 1)) {
      bad_t = bad_t + b
    } else if (h(a - 1) < h(b - 1)) {
      bad_t = bad_t + a
    } else {
      bad_t = bad_t + a
      bad_t = bad_t + b
    }
  }

  print(n - bad_t.size)
}
