n, m = list(map(int, input().split()))

H = [0] + list(map(int, input().split()))

G = [[] * (n + 1) for _ in range(n + 1)]

for i in range(m):

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

	G[a].append(b)

	G[b].append(a)



# print(G)



cnt = 0

for i in range(1, n + 1):

	path = G[i] # つながっている展望台の集合

	if len(path) == 0:

		cnt += 1

	else:

		flg = True

		for e in path:

			if H[i] <= H[e]:

				flg = False

		if flg:

			cnt += 1



print(cnt)







n, m = list(map(int, input().split()))

h = [0] + list(map(int, input().split()))

maxh = [0] * (n + 1)

for i in range(m):

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

	maxh[a] = max(maxh[a], h[b])

	maxh[b] = max(maxh[b], h[a])

	

cnt = 0

for i in range(1, n + 1):

	if h[i] > maxh[i]:

		cnt += 1

print(cnt)
n, m = list(map(int, input().split()))
H = [0] + list(map(int, input().split()))
G = [[] * (n + 1) for _ in range(n + 1)]
for i in range(m):
    a, b = list(map(int, input().split()))
    G[a].append(b)
    G[b].append(a)
# print(G)
cnt = 0
for i in range(1, n + 1):
    path = G[i]  # つながっている展望台の集合
    if len(path) == 0:
        cnt += 1
    else:
        flg = True
        for e in path:
            if H[i] <= H[e]:
                flg = False
        if flg:
            cnt += 1
print(cnt)

n, m = list(map(int, input().split()))
h = [0] + list(map(int, input().split()))
maxh = [0] * (n + 1)
for i in range(m):
    a, b = list(map(int, input().split()))
    maxh[a] = max(maxh[a], h[b])
    maxh[b] = max(maxh[b], h[a])
cnt = 0
for i in range(1, n + 1):
    if h[i] > maxh[i]:
        cnt += 1
print(cnt)

-H = [0] + list(map(int, input().split())) -G = [[] * (n + 1) for _ in range(n + 1)] +h = [0] + list(map(int, input().split())) +maxh = [0] * (n + 1) -    G[a].append(b) -    G[b].append(a) -# print(G) +    maxh[a] = max(maxh[a], h[b]) +    maxh[b] = max(maxh[b], h[a]) -    path = G[i]  # つながっている展望台の集合 -    if len(path) == 0: +    if h[i] > maxh[i]: -    else: -        flg = True -        for e in path: -            if H[i] <= H[e]: -                flg = False -        if flg: -            cnt += 1