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

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

ab = [(list(map(int, input().split())))for _ in range(m)]



l = [set({}) for _ in range(n + 1)]

for a, b in ab:

    l[a].add(b)

    l[b].add(a)



cnt = -1

for i, v in enumerate(l):

    if len(v) != 0:

        if h[i] > max([h[j] for j in v]):

            cnt += 1

    else:

        cnt += 1

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

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



bl = [True] * (n + 1)

for i in range(m):

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

    if h[a] > h[b]:

        bl[b] = False

    elif h[a] < h[b]:

        bl[a] = False

    else:

        bl[a], bl[b] = False, False

print((sum(bl) - 1))

n, m = list(map(int, input().split()))
h = [0] + list(map(int, input().split()))
ab = [(list(map(int, input().split()))) for _ in range(m)]
l = [set({}) for _ in range(n + 1)]
for a, b in ab:
    l[a].add(b)
    l[b].add(a)
cnt = -1
for i, v in enumerate(l):
    if len(v) != 0:
        if h[i] > max([h[j] for j in v]):
            cnt += 1
    else:
        cnt += 1
print(cnt)

n, m = list(map(int, input().split()))
h = [0] + list(map(int, input().split()))
bl = [True] * (n + 1)
for i in range(m):
    a, b = list(map(int, input().split()))
    if h[a] > h[b]:
        bl[b] = False
    elif h[a] < h[b]:
        bl[a] = False
    else:
        bl[a], bl[b] = False, False
print((sum(bl) - 1))

-ab = [(list(map(int, input().split()))) for _ in range(m)] -l = [set({}) for _ in range(n + 1)] -for a, b in ab: -    l[a].add(b) -    l[b].add(a) -cnt = -1 -for i, v in enumerate(l): -    if len(v) != 0: -        if h[i] > max([h[j] for j in v]): -            cnt += 1 +bl = [True] * (n + 1) +for i in range(m): +    a, b = list(map(int, input().split())) +    if h[a] > h[b]: +        bl[b] = False +    elif h[a] < h[b]: +        bl[a] = False -        cnt += 1 -print(cnt) +        bl[a], bl[b] = False, False +print((sum(bl) - 1))