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

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

ans = [1] * n

for _ in range(m):

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

    a -= 1

    b -= 1

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

        ans[a] = 0

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

        ans[b] = 0

print((sum(ans)))

n,*t=list(map(int,open(0).read().split()))

r=[0]+[1]*n

for a,b in zip(t[n+1::2],t[n+2::2]):r[a]&=t[a]>t[b];r[b]&=t[b]>t[a]

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

n, *t = list(map(int, open(0).read().split()))
r = [0] + [1] * n
for a, b in zip(t[n + 1 :: 2], t[n + 2 :: 2]):
    r[a] &= t[a] > t[b]
    r[b] &= t[b] > t[a]
print((sum(r)))

-n, m = list(map(int, input().split())) -h = list(map(int, input().split())) -ans = [1] * n -for _ in range(m): -    a, b = list(map(int, input().split())) -    a -= 1 -    b -= 1 -    if h[a] <= h[b]: -        ans[a] = 0 -    if h[b] <= h[a]: -        ans[b] = 0 -print((sum(ans))) +n, *t = list(map(int, open(0).read().split())) +r = [0] + [1] * n +for a, b in zip(t[n + 1 :: 2], t[n + 2 :: 2]): +    r[a] &= t[a] > t[b] +    r[b] &= t[b] > t[a] +print((sum(r)))