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

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

ans = [1]*n

roads = []

for i in range(m):

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

for road in roads:

    if hs[road[0]-1] <= hs[road[1]-1]:

        ans[road[0]-1] = 0

    if hs[road[0]-1] >= hs[road[1]-1]:

        ans[road[1]-1] = 0

print((ans.count(1)))

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

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

ans = [1]*n

for i in range(m):

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

    if hs[road[0]-1] <= hs[road[1]-1]:

        ans[road[0]-1] = 0

    if hs[road[0]-1] >= hs[road[1]-1]:

        ans[road[1]-1] = 0

print((ans.count(1)))

n, m = list(map(int, input().split()))
hs = list(map(int, input().split()))
ans = [1] * n
roads = []
for i in range(m):
    roads += [list(map(int, input().split()))]
for road in roads:
    if hs[road[0] - 1] <= hs[road[1] - 1]:
        ans[road[0] - 1] = 0
    if hs[road[0] - 1] >= hs[road[1] - 1]:
        ans[road[1] - 1] = 0
print((ans.count(1)))

n, m = list(map(int, input().split()))
hs = list(map(int, input().split()))
ans = [1] * n
for i in range(m):
    road = list(map(int, input().split()))
    if hs[road[0] - 1] <= hs[road[1] - 1]:
        ans[road[0] - 1] = 0
    if hs[road[0] - 1] >= hs[road[1] - 1]:
        ans[road[1] - 1] = 0
print((ans.count(1)))

-roads = [] -    roads += [list(map(int, input().split()))] -for road in roads: +    road = list(map(int, input().split()))