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

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

Hneig = [[] for _ in range(N)]

for _ in range(M):

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

    Hneig[A - 1].append(H[B - 1])

    Hneig[B - 1].append(H[A - 1])

print((sum([1 for n in range(N) if len(Hneig[n]) == 0 or H[n] > max(Hneig[n])])))

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

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

Hn = [0] * N

for _ in range(M):

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

    Hn[A - 1] = max(Hn[A - 1], H[B - 1])

    Hn[B - 1] = max(Hn[B - 1], H[A - 1])

print((sum([1 for n in range(N) if H[n] > Hn[n]])))

N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
Hneig = [[] for _ in range(N)]
for _ in range(M):
    A, B = list(map(int, input().split()))
    Hneig[A - 1].append(H[B - 1])
    Hneig[B - 1].append(H[A - 1])
print((sum([1 for n in range(N) if len(Hneig[n]) == 0 or H[n] > max(Hneig[n])])))

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

-Hneig = [[] for _ in range(N)] +Hn = [0] * N -    Hneig[A - 1].append(H[B - 1]) -    Hneig[B - 1].append(H[A - 1]) -print((sum([1 for n in range(N) if len(Hneig[n]) == 0 or H[n] > max(Hneig[n])]))) +    Hn[A - 1] = max(Hn[A - 1], H[B - 1]) +    Hn[B - 1] = max(Hn[B - 1], H[A - 1]) +print((sum([1 for n in range(N) if H[n] > Hn[n]])))