N, M, *I = list(map(int, open(0).read().split()))

H, AB = [0] + I[:N], I[N:]



memo = [0] * (N + 1)

for a, b in zip(*[iter(AB)] * 2):

    memo[a] = max(memo[a], H[b])

    memo[b] = max(memo[b], H[a])



print((sum(h > ma for h, ma in zip(H[1:], memo[1:]))))
N, M, *I = list(map(int, open(0).read().split()))

H, AB = [0] + I[:N], I[N:]



memo = [False] + [True] * N

for a, b in zip(*[iter(AB)] * 2):

    if H[a] < H[b]:

        memo[a] = False

    elif H[b] < H[a]:

        memo[b] = False

    else:

        memo[a] = memo[b] = False



print((sum(memo)))
N, M, *I = list(map(int, open(0).read().split()))
H, AB = [0] + I[:N], I[N:]
memo = [0] * (N + 1)
for a, b in zip(*[iter(AB)] * 2):
    memo[a] = max(memo[a], H[b])
    memo[b] = max(memo[b], H[a])
print((sum(h > ma for h, ma in zip(H[1:], memo[1:]))))

N, M, *I = list(map(int, open(0).read().split()))
H, AB = [0] + I[:N], I[N:]
memo = [False] + [True] * N
for a, b in zip(*[iter(AB)] * 2):
    if H[a] < H[b]:
        memo[a] = False
    elif H[b] < H[a]:
        memo[b] = False
    else:
        memo[a] = memo[b] = False
print((sum(memo)))

-memo = [0] * (N + 1) +memo = [False] + [True] * N -    memo[a] = max(memo[a], H[b]) -    memo[b] = max(memo[b], H[a]) -print((sum(h > ma for h, ma in zip(H[1:], memo[1:])))) +    if H[a] < H[b]: +        memo[a] = False +    elif H[b] < H[a]: +        memo[b] = False +    else: +        memo[a] = memo[b] = False +print((sum(memo)))