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

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

ab = sorted([sorted(list(map(int, input().split())))

             for _ in range(m)])



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



for a, b in ab:

    l[a].append(b)

    l[b].append(a)



cnt = 0

f = 0

for i, v in enumerate(l):

    for k in v:

        if h[i] <= h[k]:

            f = 1

            break

    if f == 0:

        cnt += 1

    f = 0

print((cnt - 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()))
ab = sorted([sorted(list(map(int, input().split()))) for _ in range(m)])
l = [[] for _ in range(n + 1)]
for a, b in ab:
    l[a].append(b)
    l[b].append(a)
cnt = 0
f = 0
for i, v in enumerate(l):
    for k in v:
        if h[i] <= h[k]:
            f = 1
            break
    if f == 0:
        cnt += 1
    f = 0
print((cnt - 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)

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