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 = list(map(int, input().split()))

mh = [0] * n

for i in range(m):

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

    mh[a - 1] = max(mh[a - 1], h[b - 1])

    mh[b - 1] = max(mh[b - 1], h[a - 1])

print((sum(h[i] > mh[i] for i in range(n))))
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 = list(map(int, input().split()))
mh = [0] * n
for i in range(m):
    a, b = list(map(int, input().split()))
    mh[a - 1] = max(mh[a - 1], h[b - 1])
    mh[b - 1] = max(mh[b - 1], h[a - 1])
print((sum(h[i] > mh[i] for i in range(n))))

-to = [[] for i in range(n)] +mh = [0] * n -    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)))) +    mh[a - 1] = max(mh[a - 1], h[b - 1]) +    mh[b - 1] = max(mh[b - 1], h[a - 1]) +print((sum(h[i] > mh[i] for i in range(n))))