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



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



better = [[] for _ in H]



for _ in range(M):

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

  A -= 1

  B -= 1

  if H[A] >= H[B]:

    better[B].append(A)

  if H[A] <= H[B]:

    better[A].append(B)

print((sum([1 for b in better if not b])))
N, M = list(map(int, input().split()))



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



good = [True] * N



for _ in range(M):

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

  A -= 1

  B -= 1

  if H[A] >= H[B]:

    good[B] = False

  if H[A] <= H[B]:

    good[A] = False

print((sum(good)))
N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
better = [[] for _ in H]
for _ in range(M):
    A, B = list(map(int, input().split()))
    A -= 1
    B -= 1
    if H[A] >= H[B]:
        better[B].append(A)
    if H[A] <= H[B]:
        better[A].append(B)
print((sum([1 for b in better if not b])))

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

-better = [[] for _ in H] +good = [True] * N -        better[B].append(A) +        good[B] = False -        better[A].append(B) -print((sum([1 for b in better if not b]))) +        good[A] = False +print((sum(good)))