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

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

tmp=[0]*n



for i in range(m):

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

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

        tmp[b-1]=-1

    if l[a-1] < l[b-1]:

        tmp[a-1]=-1

    if l[a-1] == l[b-1]:

        tmp[b-1]=-1

        tmp[a-1]=-1



print((tmp.count(0)))
n,m=list(map(int,input().split()))

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

tmp=[0]*n



for i in range(m):

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



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

        tmp[b-1]=-1

    elif l[a-1] == l[b-1]:

        tmp[a-1]=-1

        tmp[b-1]=-1

    else:

        tmp[a-1]=-1





print((tmp.count(0)))



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

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

-    if l[a - 1] < l[b - 1]: +    elif l[a - 1] == l[b - 1]: -    if l[a - 1] == l[b - 1]: +    else: