import kotlin.math.PI

private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int
private fun readLong() = readLn().toLong() // single long
private fun readStrings() = readLn().split(" ") // list of strings
private fun readInts() = readStrings().map(String::toInt) // list of ints
private fun readLongs() = readStrings().map(String::toLong) // list of longs

fun main() {
    val (N, M) = readInts()
    val H = readInts()
    val AB = (1..M).map { readInts() }.map { it.first() to it.component2() }
    val x = AB + AB.map { it.second to it.first }
    val y = x.groupBy { it.first }

    //println(y)
    val r = y.filter {
        //println("key: ${it.key}")
        it.value.asSequence().filter {
//            println(it.first to it.second)
//            println(H[it.first - 1] to H[it.second - 1])
//            println(H[it.first - 1] - H[it.second - 1])

            H[it.first - 1] - H[it.second - 1] <= 0
        }.onEach { println("it: $it") }
        .none()
    }.count()
    println(r + N - y.count())
}
