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([])))
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_road=[[] for i in range(N)]

for r in AB:

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

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

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

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

    else:

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

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



print((AB_road.count([])))
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([])))

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_road = [[] for i in range(N)]
for r in AB:
    if H[r[0] - 1] > H[r[1] - 1]:
        AB_road[r[1] - 1].append(r[0])
    elif H[r[0] - 1] < H[r[1] - 1]:
        AB_road[r[0] - 1].append(r[1])
    else:
        AB_road[r[1] - 1].append(r[0])
        AB_road[r[0] - 1].append(r[1])
print((AB_road.count([])))

-AB_unique = list(map(list, set(map(tuple, AB)))) -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]) +for r in AB: +    if H[r[0] - 1] > H[r[1] - 1]: +        AB_road[r[1] - 1].append(r[0]) +    elif H[r[0] - 1] < H[r[1] - 1]: +        AB_road[r[0] - 1].append(r[1]) -        AB_road[AB[1] - 1].append(AB[0]) -        AB_road[AB[0] - 1].append(AB[1]) +        AB_road[r[1] - 1].append(r[0]) +        AB_road[r[0] - 1].append(r[1])