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

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

A = []

B = []



no_good = []



for i in range(M):

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

    A.append(t[0])

    B.append(t[1])



for i in range(M):

    if H[A[i]-1] > H[B[i]-1]:

        no_good.append(B[i])

    elif H[A[i]-1] < H[B[i]-1]:

        no_good.append(A[i])

    else:

        no_good.append(A[i])

        no_good.append(B[i])



result = N - len(set(no_good))

print(result)

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

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

no_good = []



for i in range(M):

    A, B = list(map(int, input().split()))

    if H[A-1] > H[B-1]:

        no_good.append(B)

    elif H[A-1] < H[B-1]:

        no_good.append(A)

    else:

        no_good.append(A)

        no_good.append(B)



result = N - len(set(no_good))

print(result)

N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
A = []
B = []
no_good = []
for i in range(M):
    t = list(map(int, input().split()))
    A.append(t[0])
    B.append(t[1])
for i in range(M):
    if H[A[i] - 1] > H[B[i] - 1]:
        no_good.append(B[i])
    elif H[A[i] - 1] < H[B[i] - 1]:
        no_good.append(A[i])
    else:
        no_good.append(A[i])
        no_good.append(B[i])
result = N - len(set(no_good))
print(result)

N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
no_good = []
for i in range(M):
    A, B = list(map(int, input().split()))
    if H[A - 1] > H[B - 1]:
        no_good.append(B)
    elif H[A - 1] < H[B - 1]:
        no_good.append(A)
    else:
        no_good.append(A)
        no_good.append(B)
result = N - len(set(no_good))
print(result)

-A = [] -B = [] -    t = list(map(int, input().split())) -    A.append(t[0]) -    B.append(t[1]) -for i in range(M): -    if H[A[i] - 1] > H[B[i] - 1]: -        no_good.append(B[i]) -    elif H[A[i] - 1] < H[B[i] - 1]: -        no_good.append(A[i]) +    A, B = list(map(int, input().split())) +    if H[A - 1] > H[B - 1]: +        no_good.append(B) +    elif H[A - 1] < H[B - 1]: +        no_good.append(A) -        no_good.append(A[i]) -        no_good.append(B[i]) +        no_good.append(A) +        no_good.append(B)