def get_unique_list(seq):

    seen = []

    return [x for x in seq if x not in seen and not seen.append(x)]



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

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

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



AB_unique=list(map(list, set(map(tuple, AB))))



AB_road=[True]*N

for AB in AB_unique:

    if H[AB[0]-1] > H[AB[1]-1]:

        AB_road[AB[1]-1]=False

    elif H[AB[0]-1] < H[AB[1]-1]:

        AB_road[AB[0]-1]=False

    else:

        AB_road[AB[1]-1]=False

        AB_road[AB[0]-1]=False



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

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

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



AB_unique=list(map(list, set(map(tuple, AB))))



AB_road=[[] for i in range(N)]

for AB in AB_unique:

    if H[AB[0]-1] > H[AB[1]-1]:

        AB_road[AB[1]-1].append(AB[0])

    elif H[AB[0]-1] < H[AB[1]-1]:

        AB_road[AB[0]-1].append(AB[1])

    else:

        AB_road[AB[1]-1].append(AB[0])

        AB_road[AB[0]-1].append(AB[1])



print((AB_road.count([])))
def get_unique_list(seq):
    seen = []
    return [x for x in seq if x not in seen and not seen.append(x)]


N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
AB = [list(map(int, input().split())) for i in range(int(M))]
AB_unique = list(map(list, set(map(tuple, AB))))
AB_road = [True] * N
for AB in AB_unique:
    if H[AB[0] - 1] > H[AB[1] - 1]:
        AB_road[AB[1] - 1] = False
    elif H[AB[0] - 1] < H[AB[1] - 1]:
        AB_road[AB[0] - 1] = False
    else:
        AB_road[AB[1] - 1] = False
        AB_road[AB[0] - 1] = False
print((AB_road.count(True)))

N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
AB = [list(map(int, input().split())) for i in range(int(M))]
AB_unique = list(map(list, set(map(tuple, AB))))
AB_road = [[] for i in range(N)]
for AB in AB_unique:
    if H[AB[0] - 1] > H[AB[1] - 1]:
        AB_road[AB[1] - 1].append(AB[0])
    elif H[AB[0] - 1] < H[AB[1] - 1]:
        AB_road[AB[0] - 1].append(AB[1])
    else:
        AB_road[AB[1] - 1].append(AB[0])
        AB_road[AB[0] - 1].append(AB[1])
print((AB_road.count([])))

-def get_unique_list(seq): -    seen = [] -    return [x for x in seq if x not in seen and not seen.append(x)] - - -AB_road = [True] * N +AB_road = [[] for i in range(N)] -        AB_road[AB[1] - 1] = False +        AB_road[AB[1] - 1].append(AB[0]) -        AB_road[AB[0] - 1] = False +        AB_road[AB[0] - 1].append(AB[1]) -        AB_road[AB[1] - 1] = False -        AB_road[AB[0] - 1] = False -print((AB_road.count(True))) +        AB_road[AB[1] - 1].append(AB[0]) +        AB_road[AB[0] - 1].append(AB[1]) +print((AB_road.count([])))