n, m = list(map(int, input().split()))

h = [int(i) for i in input().split()]

path = [[] for i in range(n)]

set_path = set()

for i in range(m):

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

    path[a - 1].append(b - 1)

    path[b - 1].append(a - 1)

    set_path |= set((a - 1, b - 1))

cnt = n - len(set_path)

path_ = {int(i) for i in range(n)}

for i in set_path:

    if max([h[j] for j in path[i]]) < h[i]:

        cnt += 1

print(cnt)
n, m = list(map(int, input().split()))

h = list(map(int, input().split()))

to = [[] for i in range(n)]

for i in range(m):

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

    to[a - 1] += [b - 1]

    to[b - 1] += [a - 1]

print((sum(to[j] == [] or h[j] > max(h[i] for i in to[j]) for j in range(n))))
n, m = list(map(int, input().split()))
h = [int(i) for i in input().split()]
path = [[] for i in range(n)]
set_path = set()
for i in range(m):
    a, b = list(map(int, input().split()))
    path[a - 1].append(b - 1)
    path[b - 1].append(a - 1)
    set_path |= set((a - 1, b - 1))
cnt = n - len(set_path)
path_ = {int(i) for i in range(n)}
for i in set_path:
    if max([h[j] for j in path[i]]) < h[i]:
        cnt += 1
print(cnt)

n, m = list(map(int, input().split()))
h = list(map(int, input().split()))
to = [[] for i in range(n)]
for i in range(m):
    a, b = list(map(int, input().split()))
    to[a - 1] += [b - 1]
    to[b - 1] += [a - 1]
print((sum(to[j] == [] or h[j] > max(h[i] for i in to[j]) for j in range(n))))

-h = [int(i) for i in input().split()] -path = [[] for i in range(n)] -set_path = set() +h = list(map(int, input().split())) +to = [[] for i in range(n)] -    path[a - 1].append(b - 1) -    path[b - 1].append(a - 1) -    set_path |= set((a - 1, b - 1)) -cnt = n - len(set_path) -path_ = {int(i) for i in range(n)} -for i in set_path: -    if max([h[j] for j in path[i]]) < h[i]: -        cnt += 1 -print(cnt) +    to[a - 1] += [b - 1] +    to[b - 1] += [a - 1] +print((sum(to[j] == [] or h[j] > max(h[i] for i in to[j]) for j in range(n))))