N,M=list(map(int,input().split()))

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

L=[[] for i in range(N)]

for i in range(M):

  A,B=list(map(int,input().split()))

  A-=1

  B-=1

  L[A].append(B)

  L[B].append(A)

ans=0

for i in range(N):

  flag=True

  for j in L[i]:

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

      flag=False

      break

  if flag:

    ans+=1

print(ans)
N,M=list(map(int,input().split()))

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

links=[[] for i in range(N)]

for i in range(M):

  A,B=list(map(int,input().split()))

  A-=1

  B-=1

  links[A].append(B)

  links[B].append(A)

ans=0

for i in range(N):

  flag=True

  for j in links[i]:

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

      flag=False

      break      

  if flag:

    ans+=1

print(ans)
N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
L = [[] for i in range(N)]
for i in range(M):
    A, B = list(map(int, input().split()))
    A -= 1
    B -= 1
    L[A].append(B)
    L[B].append(A)
ans = 0
for i in range(N):
    flag = True
    for j in L[i]:
        if H[i] <= H[j]:
            flag = False
            break
    if flag:
        ans += 1
print(ans)

N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
links = [[] for i in range(N)]
for i in range(M):
    A, B = list(map(int, input().split()))
    A -= 1
    B -= 1
    links[A].append(B)
    links[B].append(A)
ans = 0
for i in range(N):
    flag = True
    for j in links[i]:
        if H[i] <= H[j]:
            flag = False
            break
    if flag:
        ans += 1
print(ans)

-L = [[] for i in range(N)] +links = [[] for i in range(N)] -    L[A].append(B) -    L[B].append(A) +    links[A].append(B) +    links[B].append(A) -    for j in L[i]: +    for j in links[i]: