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

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

ans = [1]*n



for i in range(m):

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

    if high[a-1] > high[b-1]:

        ans[b-1] = 0

    elif high[a-1] < high[b-1]:

        ans[a-1] = 0

    else:

        ans[a-1] = 0

        ans[b-1] = 0

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

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

ans = [0]*n

 

for i in range(m):

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

    if high[a-1] > high[b-1]:

        if ans[a-1] == 0:

            ans[a-1] = 1

        ans[b-1] = -1

    elif high[a-1] < high[b-1]:

        if ans[b-1] == 0:

            ans[b-1] = 1

        ans[a-1] = -1

    else:

        ans[b-1] = -1

        ans[a-1] = -1

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

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

-ans = [1] * n +ans = [0] * n -        ans[b - 1] = 0 +        if ans[a - 1] == 0: +            ans[a - 1] = 1 +        ans[b - 1] = -1 -        ans[a - 1] = 0 +        if ans[b - 1] == 0: +            ans[b - 1] = 1 +        ans[a - 1] = -1 -        ans[a - 1] = 0 -        ans[b - 1] = 0 -print((sum(ans))) +        ans[b - 1] = -1 +        ans[a - 1] = -1 +print((ans.count(0) + ans.count(1)))