n,m=[int(x) for x in input().split()]

h=[int(x) for x in input().split()]

road=[[]*1 for i in range(n)]

for i in range(m):

  a=[int(x) for x in input().split()]

  road[a[0]-1].append(a[1]-1)

  road[a[1]-1].append(a[0]-1)

good=[]

for i in range(n):

  if road[i]==[]:

    good.append(i)

  else:

    check=[]

    for j in road[i]:

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

        check.append(False)

    if check==[]:

      good.append(i)

print((len(good)))
n,m=[int(x) for x in input().split()]

h=[int(x) for x in input().split()]

t=[[]for i in range(n)]

ans=0

for i in range(m):

    a,b=[int(x) for x in input().split()]

    t[a-1].append(b-1)

    t[b-1].append(a-1)

for i in range(n):

    if t[i]==[]:

        ans+=1

    else:

        c=[]

        for j in t[i]:

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

                c.append(False)

        if c==[]:

            ans+=1

print(ans)
n, m = [int(x) for x in input().split()]
h = [int(x) for x in input().split()]
road = [[] * 1 for i in range(n)]
for i in range(m):
    a = [int(x) for x in input().split()]
    road[a[0] - 1].append(a[1] - 1)
    road[a[1] - 1].append(a[0] - 1)
good = []
for i in range(n):
    if road[i] == []:
        good.append(i)
    else:
        check = []
        for j in road[i]:
            if h[i] <= h[j]:
                check.append(False)
        if check == []:
            good.append(i)
print((len(good)))

n, m = [int(x) for x in input().split()]
h = [int(x) for x in input().split()]
t = [[] for i in range(n)]
ans = 0
for i in range(m):
    a, b = [int(x) for x in input().split()]
    t[a - 1].append(b - 1)
    t[b - 1].append(a - 1)
for i in range(n):
    if t[i] == []:
        ans += 1
    else:
        c = []
        for j in t[i]:
            if h[i] <= h[j]:
                c.append(False)
        if c == []:
            ans += 1
print(ans)

-road = [[] * 1 for i in range(n)] +t = [[] for i in range(n)] +ans = 0 -    a = [int(x) for x in input().split()] -    road[a[0] - 1].append(a[1] - 1) -    road[a[1] - 1].append(a[0] - 1) -good = [] +    a, b = [int(x) for x in input().split()] +    t[a - 1].append(b - 1) +    t[b - 1].append(a - 1) -    if road[i] == []: -        good.append(i) +    if t[i] == []: +        ans += 1 -        check = [] -        for j in road[i]: +        c = [] +        for j in t[i]: -                check.append(False) -        if check == []: -            good.append(i) -print((len(good))) +                c.append(False) +        if c == []: +            ans += 1 +print(ans)