import copy

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

tall = [int(e) for e in input().split()]



bridge = copy.copy(tall)



for i in range(m):

    c = [int(f)-1 for f in input().split()]

    a,b = c[0],c[1]

    if bridge[a] < tall[b]:

        bridge[a] = tall[b]

    elif bridge[a] == tall[b]:

        bridge[a] = 10**10

    if bridge[b] < tall[a]:

        bridge[b] = tall[a]

    elif bridge[b] == tall[a]:

        bridge[b] = 10**10



cnt = 0

for j in range(n):

    if tall[j] == bridge[j]:

        cnt += 1



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

tall = [int(e) for e in input().split()]



is_best = [True]*n



for i in range(m):

    c = [int(f)-1 for f in input().split()]

    a,b = c[0],c[1]

    if tall[a] < tall[b]:

        is_best[a] = False



    elif tall[b] < tall[a]:

        is_best[b] = False



    else:

        is_best[a],is_best[b] = False,False



print((is_best.count(True)))
import copy

n, m = list(map(int, input().split()))
tall = [int(e) for e in input().split()]
bridge = copy.copy(tall)
for i in range(m):
    c = [int(f) - 1 for f in input().split()]
    a, b = c[0], c[1]
    if bridge[a] < tall[b]:
        bridge[a] = tall[b]
    elif bridge[a] == tall[b]:
        bridge[a] = 10**10
    if bridge[b] < tall[a]:
        bridge[b] = tall[a]
    elif bridge[b] == tall[a]:
        bridge[b] = 10**10
cnt = 0
for j in range(n):
    if tall[j] == bridge[j]:
        cnt += 1
print(cnt)

n, m = list(map(int, input().split()))
tall = [int(e) for e in input().split()]
is_best = [True] * n
for i in range(m):
    c = [int(f) - 1 for f in input().split()]
    a, b = c[0], c[1]
    if tall[a] < tall[b]:
        is_best[a] = False
    elif tall[b] < tall[a]:
        is_best[b] = False
    else:
        is_best[a], is_best[b] = False, False
print((is_best.count(True)))

-import copy - -bridge = copy.copy(tall) +is_best = [True] * n -    if bridge[a] < tall[b]: -        bridge[a] = tall[b] -    elif bridge[a] == tall[b]: -        bridge[a] = 10**10 -    if bridge[b] < tall[a]: -        bridge[b] = tall[a] -    elif bridge[b] == tall[a]: -        bridge[b] = 10**10 -cnt = 0 -for j in range(n): -    if tall[j] == bridge[j]: -        cnt += 1 -print(cnt) +    if tall[a] < tall[b]: +        is_best[a] = False +    elif tall[b] < tall[a]: +        is_best[b] = False +    else: +        is_best[a], is_best[b] = False, False +print((is_best.count(True)))