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

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

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

ans = 0

for i in range(m):

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

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

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



for i in range(n):

    if len(path[i]) == 0:

        ans += 1

    for j in range(len(path[i])):

        if h[path[i][j]] >= h[i]:

            break

        if j == len(path[i]) - 1:

            ans += 1

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

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

ok = [1] * n

for i in range(m):

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

    a -= 1

    b -= 1

    if h[a] <= h[b]: ok[a] = 0

    if h[b] <= h[a]: ok[b] = 0



print((sum(ok)))

n, m = list(map(int, input().split()))
h = list(map(int, input().split()))
path = [[] for i in range(n)]
ans = 0
for i in range(m):
    a, b = list(map(int, input().split()))
    path[a - 1].append(b - 1)
    path[b - 1].append(a - 1)
for i in range(n):
    if len(path[i]) == 0:
        ans += 1
    for j in range(len(path[i])):
        if h[path[i][j]] >= h[i]:
            break
        if j == len(path[i]) - 1:
            ans += 1
print(ans)

n, m = list(map(int, input().split()))
h = list(map(int, input().split()))
ok = [1] * n
for i in range(m):
    a, b = list(map(int, input().split()))
    a -= 1
    b -= 1
    if h[a] <= h[b]:
        ok[a] = 0
    if h[b] <= h[a]:
        ok[b] = 0
print((sum(ok)))

-path = [[] for i in range(n)] -ans = 0 +ok = [1] * n -    path[a - 1].append(b - 1) -    path[b - 1].append(a - 1) -for i in range(n): -    if len(path[i]) == 0: -        ans += 1 -    for j in range(len(path[i])): -        if h[path[i][j]] >= h[i]: -            break -        if j == len(path[i]) - 1: -            ans += 1 -print(ans) +    a -= 1 +    b -= 1 +    if h[a] <= h[b]: +        ok[a] = 0 +    if h[b] <= h[a]: +        ok[b] = 0 +print((sum(ok)))