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

H = list(map(int, input().split()))#リスト

A = [list(map(int, input().split())) for i in range(M)]  #数字、複数行複数列



good = [True]*N

for i, j in A:

    i -= 1

    j -= 1

    if H[i] < H[j]:

        good[i] = False

    if H[i] > H[j]:

        good[j] = False

    if H[i] == H[j]:

        good[i] = False

        good[j] = False



print((good.count(True)))
n, m = list(map(int, input().split()))

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



l = [True] * n

for i in range(m):

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

    a -= 1

    b -= 1

    #print(h[a],h[b])

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

        l[b] = False

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

        l[a] = False



#print(l)

print((l.count(True)))
N, M = list(map(int, input().split()))  # 数字
H = list(map(int, input().split()))  # リスト
A = [list(map(int, input().split())) for i in range(M)]  # 数字、複数行複数列
good = [True] * N
for i, j in A:
    i -= 1
    j -= 1
    if H[i] < H[j]:
        good[i] = False
    if H[i] > H[j]:
        good[j] = False
    if H[i] == H[j]:
        good[i] = False
        good[j] = False
print((good.count(True)))

n, m = list(map(int, input().split()))
h = list(map(int, input().split()))
l = [True] * n
for i in range(m):
    a, b = list(map(int, input().split()))
    a -= 1
    b -= 1
    # print(h[a],h[b])
    if h[a] >= h[b]:
        l[b] = False
    if h[a] <= h[b]:
        l[a] = False
# print(l)
print((l.count(True)))

-N, M = list(map(int, input().split()))  # 数字 -H = list(map(int, input().split()))  # リスト -A = [list(map(int, input().split())) for i in range(M)]  # 数字、複数行複数列 -good = [True] * N -for i, j in A: -    i -= 1 -    j -= 1 -    if H[i] < H[j]: -        good[i] = False -    if H[i] > H[j]: -        good[j] = False -    if H[i] == H[j]: -        good[i] = False -        good[j] = False -print((good.count(True))) +n, m = list(map(int, input().split())) +h = list(map(int, input().split())) +l = [True] * n +for i in range(m): +    a, b = list(map(int, input().split())) +    a -= 1 +    b -= 1 +    # print(h[a],h[b]) +    if h[a] >= h[b]: +        l[b] = False +    if h[a] <= h[b]: +        l[a] = False +# print(l) +print((l.count(True)))