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

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

li = list(range(1,n+1))

ab = [list() for _ in range(m)]



p = []



ih = dict(list(zip(li, h)))



for i in range(m):

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

    c = ih[a]

    d = ih[b]

    if c>d:

        p.append(b)

    elif d>c:

        p.append(a)

    else:

        p.append(a)

        p.append(b)



print((n-len(set(p))))
n, m = list(map(int,input().split()))

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

li = [1]*n



for i in range(m):

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

    if li[a-1] == 1 and h[a-1] <= h[b-1]:

        li[a-1] = 0

    if li[b-1] == 1 and h[b-1] <= h[a-1]:

        li[b-1] = 0



print((sum(li)))
n, m = list(map(int, input().split()))
h = list(map(int, input().split()))
li = list(range(1, n + 1))
ab = [list() for _ in range(m)]
p = []
ih = dict(list(zip(li, h)))
for i in range(m):
    a, b = list(map(int, input().split()))
    c = ih[a]
    d = ih[b]
    if c > d:
        p.append(b)
    elif d > c:
        p.append(a)
    else:
        p.append(a)
        p.append(b)
print((n - len(set(p))))

n, m = list(map(int, input().split()))
h = list(map(int, input().split()))
li = [1] * n
for i in range(m):
    a, b = list(map(int, input().split()))
    if li[a - 1] == 1 and h[a - 1] <= h[b - 1]:
        li[a - 1] = 0
    if li[b - 1] == 1 and h[b - 1] <= h[a - 1]:
        li[b - 1] = 0
print((sum(li)))

-li = list(range(1, n + 1)) -ab = [list() for _ in range(m)] -p = [] -ih = dict(list(zip(li, h))) +li = [1] * n -    c = ih[a] -    d = ih[b] -    if c > d: -        p.append(b) -    elif d > c: -        p.append(a) -    else: -        p.append(a) -        p.append(b) -print((n - len(set(p)))) +    if li[a - 1] == 1 and h[a - 1] <= h[b - 1]: +        li[a - 1] = 0 +    if li[b - 1] == 1 and h[b - 1] <= h[a - 1]: +        li[b - 1] = 0 +print((sum(li)))