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

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

sore = [[0] for i in range(n)]

for i in range(m):

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

    sore[road[0]-1].append(h[road[1]-1])

    sore[road[1]-1].append(h[road[0]-1])

ans = 0

for i in range(n):

    if h[i] > max(sore[i]):

        ans+=1

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

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

s = [[0] for i in range(n)]

for i in range(m):

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

    s[a-1].append(H[b-1])

    s[b-1].append(H[a-1])

c = 0

for j in range(n):

    if H[j] > max(s[j]):

        c+= 1

print(c) 
n, m = list(map(int, input().split()))
h = list(map(int, input().split()))
sore = [[0] for i in range(n)]
for i in range(m):
    road = list(map(int, input().split()))
    sore[road[0] - 1].append(h[road[1] - 1])
    sore[road[1] - 1].append(h[road[0] - 1])
ans = 0
for i in range(n):
    if h[i] > max(sore[i]):
        ans += 1
print(ans)

n, m = list(map(int, input().split()))
H = list(map(int, input().split()))
s = [[0] for i in range(n)]
for i in range(m):
    a, b = list(map(int, input().split()))
    s[a - 1].append(H[b - 1])
    s[b - 1].append(H[a - 1])
c = 0
for j in range(n):
    if H[j] > max(s[j]):
        c += 1
print(c)

-h = list(map(int, input().split())) -sore = [[0] for i in range(n)] +H = list(map(int, input().split())) +s = [[0] for i in range(n)] -    road = list(map(int, input().split())) -    sore[road[0] - 1].append(h[road[1] - 1]) -    sore[road[1] - 1].append(h[road[0] - 1]) -ans = 0 -for i in range(n): -    if h[i] > max(sore[i]): -        ans += 1 -print(ans) +    a, b = list(map(int, input().split())) +    s[a - 1].append(H[b - 1]) +    s[b - 1].append(H[a - 1]) +c = 0 +for j in range(n): +    if H[j] > max(s[j]): +        c += 1 +print(c)