from collections import defaultdict



N, M = list(map(int, input().split(' ')))

H = tuple(map(int, input().split(' ')))

edges = defaultdict(set)



for _ in range(M):

    a, b = list(map(int, input().split(' ')))

    a -= 1

    b -= 1

    edges[a].add(b)

    edges[b].add(a)



count = 0

for i in range(N):

    hi = H[i]

    for j in edges[i]:

        if hi <= H[j]:

            break

    else:

        count += 1



print(count)

N, M = list(map(int, input().split(' ')))

H = tuple(map(int, input().split(' ')))

one_hops = [0] * N



for _ in range(M):

    a, b = list(map(int, input().split(' ')))

    a -= 1

    b -= 1

    one_hops[a] = max(one_hops[a], H[b])

    one_hops[b] = max(one_hops[b], H[a])



print((len([0 for i in range(N) if H[i] > one_hops[i]])))

from collections import defaultdict

N, M = list(map(int, input().split(" ")))
H = tuple(map(int, input().split(" ")))
edges = defaultdict(set)
for _ in range(M):
    a, b = list(map(int, input().split(" ")))
    a -= 1
    b -= 1
    edges[a].add(b)
    edges[b].add(a)
count = 0
for i in range(N):
    hi = H[i]
    for j in edges[i]:
        if hi <= H[j]:
            break
    else:
        count += 1
print(count)

N, M = list(map(int, input().split(" ")))
H = tuple(map(int, input().split(" ")))
one_hops = [0] * N
for _ in range(M):
    a, b = list(map(int, input().split(" ")))
    a -= 1
    b -= 1
    one_hops[a] = max(one_hops[a], H[b])
    one_hops[b] = max(one_hops[b], H[a])
print((len([0 for i in range(N) if H[i] > one_hops[i]])))

-from collections import defaultdict - -edges = defaultdict(set) +one_hops = [0] * N -    edges[a].add(b) -    edges[b].add(a) -count = 0 -for i in range(N): -    hi = H[i] -    for j in edges[i]: -        if hi <= H[j]: -            break -    else: -        count += 1 -print(count) +    one_hops[a] = max(one_hops[a], H[b]) +    one_hops[b] = max(one_hops[b], H[a]) +print((len([0 for i in range(N) if H[i] > one_hops[i]])))