N,M=list(map(int,input().split()))

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

A,B=[],[]

good = N

for m in range(M):

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

    A.append(a)

    B.append(b)

routes = [[] for i in range(N)]

for m in range(M):

    routes[A[m]-1].append(B[m]-1)

    routes[B[m]-1].append(A[m]-1)



for n in range(N):

    L = len(routes[n])

    for l in range(L):

        if H[n] <= H[routes[n][l]]:

            good -=1

            break

print(good)
N,M=list(map(int,input().split()))

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

ans=[1]*N

for m in range(M):

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

    if H[a-1]<H[b-1]:

        ans[a-1]=0

    elif H[a-1]>H[b-1]:

        ans[b-1]=0

    elif H[a-1]==H[b-1]:

        ans[a-1]=0

        ans[b-1]=0

print((ans.count(1)))
N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
A, B = [], []
good = N
for m in range(M):
    a, b = list(map(int, input().split()))
    A.append(a)
    B.append(b)
routes = [[] for i in range(N)]
for m in range(M):
    routes[A[m] - 1].append(B[m] - 1)
    routes[B[m] - 1].append(A[m] - 1)
for n in range(N):
    L = len(routes[n])
    for l in range(L):
        if H[n] <= H[routes[n][l]]:
            good -= 1
            break
print(good)

N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
ans = [1] * N
for m in range(M):
    a, b = list(map(int, input().split()))
    if H[a - 1] < H[b - 1]:
        ans[a - 1] = 0
    elif H[a - 1] > H[b - 1]:
        ans[b - 1] = 0
    elif H[a - 1] == H[b - 1]:
        ans[a - 1] = 0
        ans[b - 1] = 0
print((ans.count(1)))

-A, B = [], [] -good = N +ans = [1] * N -    A.append(a) -    B.append(b) -routes = [[] for i in range(N)] -for m in range(M): -    routes[A[m] - 1].append(B[m] - 1) -    routes[B[m] - 1].append(A[m] - 1) -for n in range(N): -    L = len(routes[n]) -    for l in range(L): -        if H[n] <= H[routes[n][l]]: -            good -= 1 -            break -print(good) +    if H[a - 1] < H[b - 1]: +        ans[a - 1] = 0 +    elif H[a - 1] > H[b - 1]: +        ans[b - 1] = 0 +    elif H[a - 1] == H[b - 1]: +        ans[a - 1] = 0 +        ans[b - 1] = 0 +print((ans.count(1)))