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

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

AB = []

AB = [[int(x) for x in input().split()] for m in range(M)]

Observatory=[[] for n in range(N+1)]

for a, b in AB:

  Observatory[a].append(b)

  Observatory[b].append(a)

#print(Observatory)



ans=0

for i, o in enumerate(Observatory):

  # rule2

  if not len(o):

    ans+=0

  

  # rule1

  for ab in o:

    if H[i-1]<=H[ab-1]:

      break

  else:

    ans+=1



print((ans-1)) # decrease Observatroy index 0
N, M = list(map(int, input().split()))

H = [0]+[int(h) for h in input().split()]

AB=[[] for n in range(N+1)]

for a, b in [[int(x) for x in input().split()] for m in range(M)]:

  AB[a].append(b)

  AB[b].append(a)

#print(AB)



ans=0

for i, ab in enumerate(AB):

  # rule2

  if not len(ab):

    ans+=0

  

  # rule1

  for j in ab:

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

      break

  else:

    ans+=1



print((ans-1)) # decrease Observatroy index 0

N, M = list(map(int, input().split()))
H = [int(h) for h in input().split()]
AB = []
AB = [[int(x) for x in input().split()] for m in range(M)]
Observatory = [[] for n in range(N + 1)]
for a, b in AB:
    Observatory[a].append(b)
    Observatory[b].append(a)
# print(Observatory)
ans = 0
for i, o in enumerate(Observatory):
    # rule2
    if not len(o):
        ans += 0
    # rule1
    for ab in o:
        if H[i - 1] <= H[ab - 1]:
            break
    else:
        ans += 1
print((ans - 1))  # decrease Observatroy index 0

N, M = list(map(int, input().split()))
H = [0] + [int(h) for h in input().split()]
AB = [[] for n in range(N + 1)]
for a, b in [[int(x) for x in input().split()] for m in range(M)]:
    AB[a].append(b)
    AB[b].append(a)
# print(AB)
ans = 0
for i, ab in enumerate(AB):
    # rule2
    if not len(ab):
        ans += 0
    # rule1
    for j in ab:
        if H[i] <= H[j]:
            break
    else:
        ans += 1
print((ans - 1))  # decrease Observatroy index 0

-H = [int(h) for h in input().split()] -AB = [] -AB = [[int(x) for x in input().split()] for m in range(M)] -Observatory = [[] for n in range(N + 1)] -for a, b in AB: -    Observatory[a].append(b) -    Observatory[b].append(a) -# print(Observatory) +H = [0] + [int(h) for h in input().split()] +AB = [[] for n in range(N + 1)] +for a, b in [[int(x) for x in input().split()] for m in range(M)]: +    AB[a].append(b) +    AB[b].append(a) +# print(AB) -for i, o in enumerate(Observatory): +for i, ab in enumerate(AB): -    if not len(o): +    if not len(ab): -    for ab in o: -        if H[i - 1] <= H[ab - 1]: +    for j in ab: +        if H[i] <= H[j]: