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

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

HL=[1]*N

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

for m in ML:

    a=m[0]

    b=m[1]

    ah=H[a-1]

    bh=H[b-1]

    if ah > bh:

        HL[b-1]=0

    elif bh > ah:

        HL[a-1]=0

    else:

        HL[a-1]=0

        HL[b-1]=0

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

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

OK=[True]*N

for m in range(M):

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

    if H[a-1] <= H[b-1]: OK[a-1] = False

    if H[b-1] <= H[a-1]: OK[b-1] = False

print((OK.count(True)))
N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
HL = [1] * N
ML = [list(map(int, input().split())) for _ in range(M)]
for m in ML:
    a = m[0]
    b = m[1]
    ah = H[a - 1]
    bh = H[b - 1]
    if ah > bh:
        HL[b - 1] = 0
    elif bh > ah:
        HL[a - 1] = 0
    else:
        HL[a - 1] = 0
        HL[b - 1] = 0
print((HL.count(1)))

N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
OK = [True] * N
for m in range(M):
    a, b = list(map(int, input().split()))
    if H[a - 1] <= H[b - 1]:
        OK[a - 1] = False
    if H[b - 1] <= H[a - 1]:
        OK[b - 1] = False
print((OK.count(True)))

-HL = [1] * N -ML = [list(map(int, input().split())) for _ in range(M)] -for m in ML: -    a = m[0] -    b = m[1] -    ah = H[a - 1] -    bh = H[b - 1] -    if ah > bh: -        HL[b - 1] = 0 -    elif bh > ah: -        HL[a - 1] = 0 -    else: -        HL[a - 1] = 0 -        HL[b - 1] = 0 -print((HL.count(1))) +OK = [True] * N +for m in range(M): +    a, b = list(map(int, input().split())) +    if H[a - 1] <= H[b - 1]: +        OK[a - 1] = False +    if H[b - 1] <= H[a - 1]: +        OK[b - 1] = False +print((OK.count(True)))