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

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

AB = [list(map(int, input().split())) for i in range(M)]

counts = [1]*N



for i in AB:

  if H[i[0]-1] <= H[i[1]-1]:

    counts[i[0]-1] -= 1

  if H[i[0]-1] >= H[i[1]-1]:

    counts[i[1]-1] -= 1

print((counts.count(1)))
N,M = list(map(int, input().split()))

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

L = []

for i in range(M):

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

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

    L.append(b-1)

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

    L.append(a-1)

  else:

    L.append(a-1)

    L.append(b-1)

print((N - len(set(L))))

N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
AB = [list(map(int, input().split())) for i in range(M)]
counts = [1] * N
for i in AB:
    if H[i[0] - 1] <= H[i[1] - 1]:
        counts[i[0] - 1] -= 1
    if H[i[0] - 1] >= H[i[1] - 1]:
        counts[i[1] - 1] -= 1
print((counts.count(1)))

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

-AB = [list(map(int, input().split())) for i in range(M)] -counts = [1] * N -for i in AB: -    if H[i[0] - 1] <= H[i[1] - 1]: -        counts[i[0] - 1] -= 1 -    if H[i[0] - 1] >= H[i[1] - 1]: -        counts[i[1] - 1] -= 1 -print((counts.count(1))) +L = [] +for i in range(M): +    a, b = list(map(int, input().split())) +    if H[a - 1] > H[b - 1]: +        L.append(b - 1) +    elif H[a - 1] < H[b - 1]: +        L.append(a - 1) +    else: +        L.append(a - 1) +        L.append(b - 1) +print((N - len(set(L))))