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

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



d = []

for i in range(M):

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

    d.append((A-1,B-1))



cnt = 0

res = {}

for i in range(N):

    res[i] = False

flag = {}

for i in range(N):

    flag[i] = True



for i in d:

    A = i[0]

    B = i[1]

    #print("H[A] > H[B]",H[A],H[B])

    if H[A] > H[B] and flag[A] == True:

        res[A] = True

    else:

        flag[A] = False

        res[A] = False

    #print("H[A] < H[B]",H[A],H[B])

    if H[B] > H[A] and flag[B] == True:

        res[B] = True

    else:

        flag[B] = False

        res[B] = False

print((list(flag.values()).count(True)))
N,M = list(map(int,input().split()))

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



d = []

for i in range(M):

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

    d.append((A-1,B-1))



cnt = 0

flag = {}

for i in range(N):

    flag[i] = True



for i in d:

    A = i[0]

    B = i[1]

    if not(H[A] > H[B] and flag[A] == True):

        flag[A] = False

    if not(H[B] > H[A] and flag[B] == True):

        flag[B] = False

print((list(flag.values()).count(True)))
N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
d = []
for i in range(M):
    A, B = list(map(int, input().split()))
    d.append((A - 1, B - 1))
cnt = 0
res = {}
for i in range(N):
    res[i] = False
flag = {}
for i in range(N):
    flag[i] = True
for i in d:
    A = i[0]
    B = i[1]
    # print("H[A] > H[B]",H[A],H[B])
    if H[A] > H[B] and flag[A] == True:
        res[A] = True
    else:
        flag[A] = False
        res[A] = False
    # print("H[A] < H[B]",H[A],H[B])
    if H[B] > H[A] and flag[B] == True:
        res[B] = True
    else:
        flag[B] = False
        res[B] = False
print((list(flag.values()).count(True)))

N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
d = []
for i in range(M):
    A, B = list(map(int, input().split()))
    d.append((A - 1, B - 1))
cnt = 0
flag = {}
for i in range(N):
    flag[i] = True
for i in d:
    A = i[0]
    B = i[1]
    if not (H[A] > H[B] and flag[A] == True):
        flag[A] = False
    if not (H[B] > H[A] and flag[B] == True):
        flag[B] = False
print((list(flag.values()).count(True)))

-res = {} -for i in range(N): -    res[i] = False -    # print("H[A] > H[B]",H[A],H[B]) -    if H[A] > H[B] and flag[A] == True: -        res[A] = True -    else: +    if not (H[A] > H[B] and flag[A] == True): -        res[A] = False -    # print("H[A] < H[B]",H[A],H[B]) -    if H[B] > H[A] and flag[B] == True: -        res[B] = True -    else: +    if not (H[B] > H[A] and flag[B] == True): -        res[B] = False