import collections



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

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

a = []

b = []

loser = []



for i in range(M):

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

    a.append(A)

    b.append(B)



    if H[a[i]-1] > H[b[i]-1]:

        loser.append(b[i])



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

        loser.append(b[i])

        loser.append(a[i])



    elif H[a[i]-1] < H[b[i]-1]:

        loser.append(a[i])



X = len(collections.Counter(loser))

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

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

win = [1]*N



for _ in range(M):

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

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

        win[B-1] = 0

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

        win[A-1] = 0

    else:

        win[A-1] = 0

        win[B-1] = 0



print((sum(win)))
import collections

N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
a = []
b = []
loser = []
for i in range(M):
    A, B = list(map(int, input().split()))
    a.append(A)
    b.append(B)
    if H[a[i] - 1] > H[b[i] - 1]:
        loser.append(b[i])
    elif H[a[i] - 1] == H[b[i] - 1]:
        loser.append(b[i])
        loser.append(a[i])
    elif H[a[i] - 1] < H[b[i] - 1]:
        loser.append(a[i])
X = len(collections.Counter(loser))
print((N - X))

N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
win = [1] * N
for _ in range(M):
    A, B = list(map(int, input().split()))
    if H[A - 1] > H[B - 1]:
        win[B - 1] = 0
    elif H[A - 1] < H[B - 1]:
        win[A - 1] = 0
    else:
        win[A - 1] = 0
        win[B - 1] = 0
print((sum(win)))

-import collections - -a = [] -b = [] -loser = [] -for i in range(M): +win = [1] * N +for _ in range(M): -    a.append(A) -    b.append(B) -    if H[a[i] - 1] > H[b[i] - 1]: -        loser.append(b[i]) -    elif H[a[i] - 1] == H[b[i] - 1]: -        loser.append(b[i]) -        loser.append(a[i]) -    elif H[a[i] - 1] < H[b[i] - 1]: -        loser.append(a[i]) -X = len(collections.Counter(loser)) -print((N - X)) +    if H[A - 1] > H[B - 1]: +        win[B - 1] = 0 +    elif H[A - 1] < H[B - 1]: +        win[A - 1] = 0 +    else: +        win[A - 1] = 0 +        win[B - 1] = 0 +print((sum(win)))