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

ans= 0

rs = []

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

ds = {}

ok = True

for i in range(m):

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

    if(a in ds):

        ds[a].append(b)

    if(b in ds):

        ds[b].append(a)

    if(a not in ds):

        ds[a] = [b]

    if(b not in ds):

        ds[b] = [a]

for i in range(1, n+1):

    if(i not in ds):

        ans +=1

    else:

        for l in ds[i]:

            if(hs[i-1] <= hs[l-1]):

                ok = False

        if(ok):

            ans +=1

        ok = True

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

ans= 0

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

ds = {}

ok = True

for i in range(m):

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

    if(a in ds):

        ds[a].append(b)

    if(b in ds):

        ds[b].append(a)

    if(a not in ds):

        ds[a] = [b]

    if(b not in ds):

        ds[b] = [a]

for i in range(1, n+1):

    if(i not in ds):

        ans +=1

    else:

        for l in ds[i]:

            if(hs[i-1] <= hs[l-1]):

                ok = False

        if(ok):

            ans +=1

        ok = True

print(ans)

n, m = list(map(int, input().split()))
ans = 0
rs = []
hs = list(map(int, input().split()))
ds = {}
ok = True
for i in range(m):
    a, b = list(map(int, input().split()))
    if a in ds:
        ds[a].append(b)
    if b in ds:
        ds[b].append(a)
    if a not in ds:
        ds[a] = [b]
    if b not in ds:
        ds[b] = [a]
for i in range(1, n + 1):
    if i not in ds:
        ans += 1
    else:
        for l in ds[i]:
            if hs[i - 1] <= hs[l - 1]:
                ok = False
        if ok:
            ans += 1
        ok = True
print(ans)

n, m = list(map(int, input().split()))
ans = 0
hs = list(map(int, input().split()))
ds = {}
ok = True
for i in range(m):
    a, b = list(map(int, input().split()))
    if a in ds:
        ds[a].append(b)
    if b in ds:
        ds[b].append(a)
    if a not in ds:
        ds[a] = [b]
    if b not in ds:
        ds[b] = [a]
for i in range(1, n + 1):
    if i not in ds:
        ans += 1
    else:
        for l in ds[i]:
            if hs[i - 1] <= hs[l - 1]:
                ok = False
        if ok:
            ans += 1
        ok = True
print(ans)

-rs = []