import collections

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

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

ans=[1]*N

for _ in range(M):

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

    if H[AB[0]-1] < H[AB[1]-1]:

        ans[AB[0]-1]=0

    elif H[AB[0]-1] > H[AB[1]-1]:

        ans[AB[1]-1]=0

    else:

        ans[AB[0]-1]=0

        ans[AB[1]-1]=0

c=collections.Counter(ans)

print((c[1]))

import collections

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

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

ans=[1]*N

for _ in range(M):

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

    if H[AB[0]-1] < H[AB[1]-1]:

        ans[AB[0]-1]=0

    elif H[AB[0]-1] > H[AB[1]-1]:

        ans[AB[1]-1]=0

    else:

        ans[AB[0]-1]=0

        ans[AB[1]-1]=0

#c=collections.Counter(ans)

print((ans.count(1)))
import collections

N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
ans = [1] * N
for _ in range(M):
    AB = list(map(int, input().split()))
    if H[AB[0] - 1] < H[AB[1] - 1]:
        ans[AB[0] - 1] = 0
    elif H[AB[0] - 1] > H[AB[1] - 1]:
        ans[AB[1] - 1] = 0
    else:
        ans[AB[0] - 1] = 0
        ans[AB[1] - 1] = 0
c = collections.Counter(ans)
print((c[1]))

import collections

N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
ans = [1] * N
for _ in range(M):
    AB = list(map(int, input().split()))
    if H[AB[0] - 1] < H[AB[1] - 1]:
        ans[AB[0] - 1] = 0
    elif H[AB[0] - 1] > H[AB[1] - 1]:
        ans[AB[1] - 1] = 0
    else:
        ans[AB[0] - 1] = 0
        ans[AB[1] - 1] = 0
# c=collections.Counter(ans)
print((ans.count(1)))

-c = collections.Counter(ans) -print((c[1])) +# c=collections.Counter(ans) +print((ans.count(1)))