peterverebics/CodeNet_Python_118 huggingface dataset:
N,M=map(int,input().split())

H=[0]+list(map(int,input().split()))

J={x:[] for x in range(1,N+1)}

for i in range(M):
    a,b=map(int,input().split())
    J[a].append(b)
    J[b].append(a)

S=0
for x in J:
    f=1
    for y in J[x]:
        if H[x]<=H[y]:
            f=0
    S+=f

print(S)
n, m = map(int, input().split())
H = list(map(int, input().split()))
A = [0]*n
for i in range(m):
    a, b = map(int, input().split())
    A[a-1] = max(A[a-1], H[b-1])
    A[b-1] = max(A[b-1], H[a-1])
ans = 0
for i in range(n):
    if H[i] > A[i]:
        ans += 1

print(ans)
N, M = map(int, input().split())
H = [int(i) for i in input().split()]
path = []
total = N
good = [1]*N
for i in range(M):
    new = [int(j) for j in input().split()]
    path.append(new)
    if H[new[0]-1] <= H[new[1]-1]:
        if good[new[0]-1] == 1:
            good[new[0]-1] = 0
            total -= 1
    if H[new[1]-1] <= H[new[0]-1]:
        if good[new[1]-1] == 1:
            good[new[1]-1] = 0
            total -= 1
print(total)
n,m = map(int,input().split())
h = list(map(int,input().split()))

A = [0 for _ in range(m)]
B = [0 for _ in range(m)]
H = [0 for _ in range(n)]

for i in range(m):
    a,b = map(int,input().split())
    H[a-1] = max(H[a-1],h[b-1])
    H[b-1] = max(H[b-1],h[a-1])

c = 0
for i in range(n):
    if(H[i] < h[i]):c += 1
print(c)
n,m=map(int,input().split())
h=list(map(int,input().split()))
a=list([1 for _ in range(n)])

for _ in range(m):
  b,c= map(int,input().split())
  if h[b-1]<h[c-1]:
    a[b-1]=0
  elif h[b-1]==h[c-1]:
    a[b-1]=0
    a[c-1]=0
  else:
    a[c-1]=0
print(sum(a))
N, M = map(int, input().split())
H = list(map(int, input().split()))
AB = [list(map(int, input().split())) for _ in range(M)]
result = 0
flag = [True] * N
result = N
for a, b in AB:
    if H[a-1] < H[b-1]:
        flag[a-1] = False
    elif H[a-1] > H[b-1]:
        flag[b-1] = False
    else:
        flag[a-1] = False
        flag[b-1] = False
print(flag.count(True))
n, m=map(int, input().split())
h=list(map(int, input().split()))
 
t=[0]*n
 
for i in range(m):
    a, b=map(int, input().split())
 
    t[a-1]=max(t[a-1], h[b-1])
    t[b-1]=max(t[b-1], h[a-1])
 
ans=0
 
for i in range(n):
    if h[i]>t[i]:
        ans+=1
 
print(ans)
N,M = map(int, input().split())
H = list(map(int, input().split()))
A = [0] * M
B = [0] * M
high = [1]*N
for i in range(M):
    A, B = map(int, input().split())
    if H[A-1] > H[B-1]:
      high[B-1] = 0
    elif H[A-1] < H[B-1]:
      high[A-1] = 0
    else:
      high[B-1] = 0
      high[A-1] = 0

even = filter(lambda x:x ==1, high)		#
print(len(list(even)))
n, m = map(int, input().split())
h = list(map(int, input().split()))
path = list(list(map(int, input().split())) for _ in range(m))

table = [1]*n

for i in range(m):
    p = path[i]
    if h[p[0]-1] <= h[p[1]-1]:
        table[p[0]-1] = 0
    if h[p[0]-1] >= h[p[1]-1]:
        table[p[1]-1] = 0

        
cnt = 0
for i in table:
    if i == 1:
        cnt += 1
        
print(cnt)
N, M = list(map(int, input().split()))
H = list(map(int, input().split()))

AB = []
for i in range(M):
    a, b = list(map(int, input().split()))
    AB.append([a-1, b-1])

# nh = [0] * N
ans = [True] * N

for a, b in AB:
    if H[a] == H[b]:
        ans[a] = False
        ans[b] = False
    elif H[a] > H[b]:
        ans[b] = False
    else:
        ans[a] = False

r = ans.count(True)
print(r)
N, M = map(int, input().split())
H = list(map(int, input().split()))
AB = []
for _ in range(M):
    AB.append(tuple(map(int, input().split())))
AB = list(set(AB))


G = [[] for _ in range(N)]
for el in AB:
    A, B = el
    A -= 1
    B -= 1
    G[A].append(B)
    G[B].append(A)
# print(H)
# print(G)

cnt = 0
for i in range(N):
    flag = True
    for next in G[i]:
        if H[i] <= H[next]:
            flag = False
    if flag:
        # print(i)
        cnt += 1
print(cnt)
N,M = map(int,input().split())
H = list(map(int,input().split()))
Bad = dict()

for i in range(M):
  A,B = map(int,input().split())
  A -= 1
  B -= 1
  if H[A] > H[B]:
    Bad[B] = 1
  elif H[A] < H[B]:
    Bad[A] = 1
  else:
    Bad[A] = 1
    Bad[B] = 1
print(N-len(Bad))
n, m = map(int, input().split())
h = list(map(int, input().split()))
data = [1 for i in range(n)]

for j in range(m):
  a, b = map(int, input().split())
  if h[a-1] <= h[b-1]:
    data[a-1] = 0
  if h[a-1] >= h[b-1]:
    data[b-1] = 0

result = 0

for i in data:
  if i == 1:
    result += 1

print(result)
N,Q = map(int,input().split())
h = list(map(int,input().split()))
l = [1]*N
for i in range(Q):
    a,b = map(int,input().split())
    a-=1
    b-=1
    if h[a] > h[b]:
        l[b] = 0
    elif h[a] < h[b]:
        l[a] = 0
    else:
        l[a] = 0
        l[b] = 0
print(sum(l))
n,m=map(int,input().split())
h=input().split()
r=[]
for i in range(m):
 r.append([])
 r[i]=input().split()
a=[1]*n
for i in range(m):
 if int(h[int(r[i][0])-1])>int(h[int(r[i][1])-1]):
  a[int(r[i][1])-1]="0"
 elif int(h[int(r[i][0])-1])<int(h[int(r[i][1])-1]):
  a[int(r[i][0])-1]="0"
 elif int(h[int(r[i][0])-1])==int(h[int(r[i][1])-1]):
  a[int(r[i][0])-1]=a[int(r[i][1])-1]="0"
print(n-(a.count("0")))
N, M = map(int, input().split())
H = list(map(int, input().split()))

L = [0 for i in range(N+1)]

for q in range(M):
  A, B = map(int, input().split())
  if H[A-1] < H[B-1]:
    L[A] += 1
  elif H[A-1] > H[B-1]:
    L[B] += 1
  else:
    L[A] += 1
    L[B] += 1
    
ans = 0
for i in range(1,N+1):
  if L[i] == 0:
    ans += 1
print(ans)
N,M = map(int,input().split())
H = list(map(int,input().split()))
W = [1 for i in range(N)]
for i in range(M):
    a,b = map(int,input().split())
    if H[a-1] >= H[b-1]:
        W[b-1] = 0
    if H[b-1] >= H[a-1]:
        W[a-1] = 0
ans = 0
for i in W:
    ans += i
print(ans)
n, m = map(int, input().split())
hlist = list(map(int, input().split()))
rlist = [list(map(int, input().split())) for i in range(m)]

list = [1]*n
for i in range(m):
    a = rlist[i][0] - 1
    b = rlist[i][1] - 1
    if hlist[a] <= hlist[b]:
        list[a] = 0
    if hlist[a] >= hlist[b]:
        list[b] = 0

print(list.count(1))
n,m = map(int,input().split())
h = list(map(int,input().split()))
ans = [1] * n
for i in range(m):
  a,b, = map(int,input().split())
  if h[a-1] >= h[b-1]:
    ans[b-1] =0
  if h[a-1] <= h[b-1]:
    ans[a-1] = 0
print(sum(ans))
N, M = map(int, input().split())
heights = list(map(int,input().split()))
lose = []

for i in range(M):
  x, y = map(int, input().split())
  if heights[x - 1] > heights[y - 1]:
    lose.append(y)
  elif heights[x - 1] < heights[y - 1]:
    lose.append(x)
  elif heights[x - 1] == heights[y - 1]:
    lose.append(y)
    lose.append(x)

print(N - len(list(set(lose))))
n, m = map(int, input().split())
h = [int(x) for x in input().split()]

chk = [True]*n

for i in range(m):
    a, b = map(int, input().split())
    if h[a-1] > h[b-1]:
        chk[b-1] = False
    elif h[a-1] < h[b-1]:
        chk[a-1] = False
    else:
        chk[a-1] = False
        chk[b-1] = False

print(chk.count(True))
ri = lambda: map(int, input().split())

N, M = ri()
H = list(ri())
T = [0]*N
for _ in range(M):
    a, b = ri()
    T[a-1] = max(T[a-1], H[b-1])
    T[b-1] = max(T[b-1], H[a-1])

print(sum(1 for i, h in enumerate(T) if h == 0 or h < H[i]))
N, M = map(int, input().split())
H = list(map(int, input().split()))
connection = [0 for _ in range(N)]
cnt = 1
result = 0
for _ in range(M):
    A, B = map(int, input().split())
    if H[A-1] < H[B-1]:
        connection[A-1] = -1
    elif H[A-1] > H[B-1]:
        connection[B-1] = -1
    else:
        connection[B-1] = -1
        connection[A-1] = -1

for i in connection:
    if i == 0:
        result += 1

print(result)
import sys
input = sys.stdin.readline

def ppp(n,m,h,ab):
    g = [1] * n
    for l,r in ab:
        if h[l-1] >= h[r-1]:
            g[r-1] = 0
        if h[l-1] <= h[r-1]:
            g[l-1] = 0
    print(sum(g))
if __name__ == "__main__":
    n,m = map(int,input().split())
    h = list(map(int,input().split()))
    ab = [list(map(int,input().split())) for _ in range(m)]
    ab_sorted = sorted(ab)
    ppp(n,m,h,ab_sorted)
N,M=map(int,input().split())
H=list(map(int,input().split()))
Hmax=H.copy()

for _ in range(M):
    a,b=map(int,input().split())
    if H[a-1] > H[b-1]:
        Hmax[b-1]=0
    elif H[a-1] < H[b-1]:
        Hmax[a-1]=0
    else:
        Hmax[a-1]=0
        Hmax[b-1]=0

print(N-Hmax.count(0))
from collections import deque
n,m=[int(_) for _ in input().split()]
H=[int(_) for _ in input().split()]
Hlist=deque(deque() for a in range(n))
count=0
for a in range(m):
    a,b=[int(_) for _ in input().split()]
    Hlist[a-1].append(b-1)
    Hlist[b-1].append(a-1)
for i,j in enumerate(Hlist):
    flag=1
    for a in j:
        if H[a]>=H[i]:
            flag=0
    if flag==1:
        count+=1
    flag=1
print(count)
N, M = map(int, input().split())
H = list(map(int, input().split()))
A = [True for i in range(N)]
for i in range(M) :
    a,b = map(int, input().split())
    a -= 1
    b -= 1
    if(H[a] <= H[b]) :
        A[a] = False
    if(H[b] <= H[a]) :
        A[b] = False

ans = 0
for i in range(N) :
    if(A[i]) :
        ans += 1
print(ans)
n,m=map(int,input().split())
h=list(map(int,input().split()))

f=[True]*n

for i in range(m):
  ai,bi=map(int,input().split())
  ai-=1
  bi-=1
  if h[ai]==h[bi]:
    f[ai]=False
    f[bi]=False
  elif h[ai]>h[bi]:
    f[bi]=False
  elif h[ai]<h[bi]:
    f[ai]=False

print(sum(f))
N,M = map(int,input().split())
H = input().split()
good = [1]*N
import collections

for i in range(M):
  a,b = map(int,input().split())
  if int(H[a-1]) > int(H[b-1]):
    good[b-1] = 0
  elif int(H[a-1]) < int(H[b-1]):
    good[a-1] = 0
  else:
    good[a-1] = 0
    good[b-1] = 0
    
c = collections.Counter(good)
print(c[1])
n, m = list(map(int,input().split()))
h = list(map(int,input().split()))
ma = [0]*n
count = 0
for i in range(m):
    a, b = list(map(int,input().split()))
    ma[a-1] = max(ma[a-1],h[b-1])
    ma[b-1] = max(ma[b-1],h[a-1])

for i in range(n):
    if(ma[i]==0 or h[i]>ma[i]):
        count += 1
print(count)
N,M = map(int,input().split())
H = list(map(int,input().split()))
road = []
for i in range(M):
    road.append(list(map(int,input().split())))

bad_ob = []

for i in range(M):
    if H[road[i][0]-1] > H[road[i][1]-1]:
        bad_ob.append(road[i][1]-1)
    elif H[road[i][0]-1] < H[road[i][1]-1]:
        bad_ob.append(road[i][0]-1)
    else:
        bad_ob.append(road[i][0]-1)
        bad_ob.append(road[i][1]-1)


print(N-len(set(bad_ob)))
I=lambda : list(map(int,input().split()))
n,m= I()
l=I();an=[1]*n
for i in range(m):
  a,b=I()
  if l[a-1]<l[b-1]:
    an[a-1]=0
  elif l[a-1]>l[b-1]:
    an[b-1]=0
  else:
    an[b-1]=an[a-1]=0
print(an.count(1))
n,m = map(int, input().split())
h = list(map(int, input().split()))

dp = [0]*n

for i in range(m):
    a,b = map(int, input().split())
    if h[a-1] >= h[b-1]:
        dp[b-1] = dp[b-1] + 1
    if h[b-1] >= h[a-1]:
        dp[a-1] = dp[a-1] + 1

print(dp.count(0))
n,m = map(int,input().split())
hi = [0] + list(map(int,input().split()))
judge = [0]+[1]*(n)

for _ in range(m):
    a,b = map(int, input().split())
    if hi[a] >= hi[b]:
        judge[b] = 0
    if hi[a] <= hi[b]:
        judge[a] = 0
print(sum(judge))
n, m = map(int, input().split())
h = list(map(int, input().split()))

tmp = []
ans = [0]*n
for i in range(m):
    a, b = map(int, input().split())
    tmp.append([a, b])

    if h[a-1] == h[b-1]:
        ans[a-1] = -1
        ans[b-1] = -1
    else:
        if h[a-1] > h[b-1]:
            ans[b-1] = -1
        else:
            ans[a-1] = -1

ans_ = ans.count(0)
print(ans_)
n,m = map(int, input().split())
h = list(map(int, input().split()))

ab = [0]*n
for _ in range(m):
  a,b = map(int, input().split())
  ab[a-1] = max(ab[a-1], h[b-1])
  ab[b-1] = max(ab[b-1], h[a-1])

ans = 0 
for i in range(n):
  if ab[i] < h[i]:
    ans += 1
print(ans)
import sys, math
import bisect, heapq
import collections

sys.setrecursionlimit(10 ** 6)

input = sys.stdin.readline

gets = lambda: input().rstrip()
getn = lambda: int(input())
getmul = lambda: (int(i) for i in input().split())
getlist = lambda: [int(i) for i in input().split()]

n, m = getmul()
H = [0] + getlist()
good = [1 for _ in range(n + 1)]
for _ in range(m):
    a, b = getmul()
    if H[a] <= H[b]:
        good[a] = 0
    if H[b] <= H[a]:
        good[b] = 0

print(sum(good) - 1)
N,M = map(int,input().split())
H = [0]
h = list(map(int,input().split()))
H += h 
AB = []
for i in range(M):
    A,B = map(int,input().split())
    AB.append([A,B])
h = [0]
for i in range(N):
    h.append(1)
    
for k in range (M):
    i = AB[k][0]
    j = AB[k][1]
    if H[i] < H[j]:
        h[i] = 0
    elif H[i] > H[j]:
        h[j] = 0
    else:
        h[i] = 0
        h[j] = 0

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

g = {}
for i in range(1, n+1):
    g[i] = 0

for _ in range(m):
    a, b = map(int, input().split())
    if g[a] < h[b-1]:
        g[a] = h[b-1]
    if g[b] < h[a-1]:
        g[b] = h[a-1]

ans = 0
for i in range(1, n+1):
    if h[i-1] > g[i]:
        ans += 1
print(ans)
N,M = map(int,input().split())
H = list(map(int,input().split()))
counter = [1] * N
for i in range(M):
    A,B = map(int,input().split())
    if H[A-1] > H[B-1]:
        counter[B-1] = 0
    if H[A-1] < H[B-1]:
        counter[A-1] = 0
    if H[A-1] == H[B-1]:
        counter[A-1] = 0
        counter[B-1] = 0
print(sum(counter))
n, m = map(int, input().split())
h = list(map(int, input().split()))
min_ab = set()
for i in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    if h[a] <= h[b]:
        min_ab.add(a)
    if h[b] <= h[a]:
        min_ab.add(b)

print(n - len(min_ab))
N, M = map(int, input().split())
h = [int(c) for c in input().split()]
dic = [[] for i in range(N)]
for i in range(M):
  a,b = map(int, input().split())
  dic[a-1] += [b-1]
  dic[b-1] += [a-1]

ls = list(range(N))
ans = 0
for c in ls:
  flag = True
  for p in dic[c]:
    if h[c]<=h[p]:
      flag = False
  if flag:
    ans += 1
print(ans)
n, m = map(int,input().split())
h = list(map(int,input().split()))
n_ans=[1]*n

for i in range(m):
    a, b = map(int,input().split())
    if h[a-1] <= h[b-1] and n_ans[a-1] == 1:
        n_ans[a-1] = 0
    if h[b-1] <= h[a-1] and n_ans[b-1] == 1:
        n_ans[b-1] = 0
print(sum(n_ans))
N,M = map(int,input().split())
H = list(map(int,input().split()))
g = [[] for i in range(1,N+1)]
ans = 0
for i in range(M):
    a,b = map(int,input().split())
    g[a-1].append(b-1)
    g[b-1].append(a-1)
for i in range(N):
    flag = 0
    for j in range(len(g[i])):
        if H[i] <= H[g[i][j]]:
            flag += 1
            break
    if flag == 0:
        ans += 1
print(ans)
n,m = map(int,input().split())
heights = list(map(int, input().split()))
a = []
b = []
for i in range (0, m):
    am, bm =map(int,input().split())
    a.append(am)
    b.append(bm)
not_peaks = {}
for i in range(0, m):
    if heights[a[i]-1]>heights[b[i]-1]:
        not_peaks[b[i]]=0
    elif heights[b[i]-1]>heights[a[i]-1]:
        not_peaks[a[i]]=0
    else:
        not_peaks[a[i]]=0
        not_peaks[b[i]]=0
print(n-len(not_peaks))
import collections
n,m = map(int, input().split())
hy = map(int, input().split())
h = list(hy)
count = [0]*n
for _ in range(m):
    a,b = map(int, input().split())
    if h[a-1] > h[b-1]:
        count[b-1] = 1
    if h[a-1] < h[b-1]:
        count[a-1] = 1
    if h[a-1] == h[b-1]:
        count[a-1] = 1
        count[b-1] = 1
c = collections.Counter(count)
print(c[0])
N, M = map(int, input().split())
H = [int(x) for x in input().split()]

a = [0]*len(H)

for i in range(M):
    A = [int(x) for x in input().split()]
    if H[A[0]-1] > H[A[1]-1]:
        a[A[1]-1] += -1
    elif H[A[0]-1] == H[A[1]-1]:
        a[A[0]-1] += -1
        a[A[1]-1] += -1
    else:
        a[A[0]-1] += -1

print(a.count(0))
# -*- coding: utf-8 -*-
N, M = map(int, input().split())
H_list = list(map(int, input().split()))

low_set = set()
for i in range(M):
    A, B = map(int, input().split())
    if H_list[A - 1] == H_list[B - 1]:
        low_set.add(A)
        low_set.add(B)
    elif H_list[A - 1] > H_list[B - 1]:
        low_set.add(B)
    else:
        low_set.add(A)

print(N - len(low_set))
n,m = map(int,input().split())
h = list(map(int,input().split()))
ans = [1 for i in range(n)]
for i in range(m):
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    #print(h[a],h[b])
    if h[a] > h[b]:
        ans[b] = 0
    elif h[b] > h[a]:
        ans[a] = 0
    else:
        ans[a],ans[b] = 0,0

#print(ans)
print(ans.count(1))
N,M=map(int,input().split())
H=list(map(int,input().split()))
flg=[0]*N
T=[[] for _ in range(N)]

for m in range(M):
  a,b =map(int,input().split())
  T[a-1].append(b)
  T[b-1].append(a)

for n in range(N):
  if not T[n]:
    flg[n] =1
  else:
    MAX=max([H[t-1] for t in T[n]])
    if H[n]>MAX:
    	flg[n]=1

print(sum(flg))
n,m = (int(i) for i in input().split())
h = [int(i) for i in input().split()]
maxTower = [1] * n 

for i in range(m):
	a,b = (int(j) for j in input().split())
	if h[a-1] == h[b-1]:
		maxTower[a-1] = 0
		maxTower[b-1] = 0
	elif h[a-1] < h[b-1]:
		maxTower[a-1] = 0
	else:
		maxTower[b-1] = 0

print(maxTower.count(1))
N, M = map(int, input().split())
H = list(map(int, input().split()))

P = [[] for _ in range(N)]

for j in range(M):
    A, B = map(int, input().split())
    P[A-1].append(H[B-1])
    P[B-1].append(H[A-1])

good = 0
for n in range(N):
    if len(P[n]) == 0 or H[n] > max(P[n]):
        good += 1
print(good)
n, m = map(int, input().split())
h = list(map(int, input().split()))
t = [1 for _ in range(n)]

for i in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    if h[a] > h[b]:
        t[b] = 0
    elif h[a] == h[b]:
        t[a] = 0
        t[b] = 0
    else:
        t[a] = 0
ans = 0
for i in t:
    if i==1:
        ans += 1
print(ans)
N, M = map(int, input().split())
H_list = list(map(int, input().split()))
ans = [1]*N
for _ in range(M):
    A, B  = map(int, input().split())
    if H_list[A - 1] < H_list[B - 1]:
        ans[A - 1] = 0
    elif H_list[A - 1] == H_list[B - 1]:
        ans[A - 1], ans[B - 1] = 0, 0
    else:
        ans[B - 1] = 0

print(sum(ans))
N,M=map(int,input().split())
L=[[] for _ in range(N)]
H=list(map(int,input().split()))
p=0
for i in range(M):
    a,b=map(int,input().split())
    L[a-1].append(b-1)
    L[b-1].append(a-1)
for i in range(N):
    s=0
    for x in L[i]:
        if H[x]>=H[i]:
            s=1
            break
    if s==0:
        p+=1
print(p)
n,m = map(int,input().split())
h = list(map(int,input().split()))
h_ngh = [0]*n
for _ in range(m):
    a,b = map(int,input().split())
    a-=1
    b-=1
    h_ngh[a] = max(h_ngh[a],h[b])
    h_ngh[b] = max(h_ngh[b],h[a])
cnt = 0
for i in range(n):
    if h_ngh[i] <h[i]:
        cnt+=1
print(cnt)
N, M = map(int, input().split())
ListH = list(map(int, input().split()))
ListAB = [list(map(int, input().split())) for i in range(M)]

Cnt=[0]*N

for i in range(M):
  if ListH[ListAB[i][0]-1]==ListH[ListAB[i][1]-1]:
    Cnt[ListAB[i][0]-1] = 1
    Cnt[ListAB[i][1]-1] = 1  
  else :
    if ListH[ListAB[i][0]-1] > ListH[ListAB[i][1]-1]:
      Cnt[ListAB[i][1]-1]=1
    if ListH[ListAB[i][0]-1] < ListH[ListAB[i][1]-1]:
      Cnt[ListAB[i][0]-1]=1

print(Cnt.count(0))
n,m=list(map(int, input().split()))
h=list(map(int, input().split()))
aa = []
ab = []
for j in range(m):
    a1,b1=[int(j) for j in input().split()]
    aa.append(a1)
    ab.append(b1)
d=[1]*n
for i in range (m):
    x=aa[i]-1
    y=ab[i]-1
    if h[x]>h[y]:
        d[y]=0
    elif h[x]==h[y]:
        d[x]=0
        d[y]=0
    else:
        d[x]=0
su=0
for f in range(n):
    su+=d[f]
print(su)
n, m = map(int, input().split())
h = list(map(int, input().split()))
edge = [[] for i in range(n)]

for i in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    edge[a].append(h[b])
    edge[b].append(h[a])

cnt = 0
for v in range(n):
    res = True
    for i in edge[v]:
        if h[v] <= i: res = False
    if res: cnt += 1

print(cnt)
n, m = map(int, input().split())
h = list(map(int, input().split()))
good = [1] * n
for i in range(m):
    a, b = map(int, input().split())
    a, b = a-1, b-1
    if h[a] > h[b]:
        good[b] = 0
    elif h[a] < h[b]:
        good[a] = 0
    else:
        good[a] = 0
        good[b] = 0

print(sum(good))
N, M = map(int, input().split())
H = list(map(int, input().split()))
A = []
B = []
result = [1]*N
for i in range(M):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)

for a, b in zip(A, B):
    if H[a-1] <= H[b-1]:
        result[a-1] = 0

for a, b in zip(B, A):
    if H[a-1] <= H[b-1]:
        result[a-1] = 0

print(result.count(1))
N, M = map(int, input().split())
H = list(map(int, input().split()))

ans = [False for _ in range(N)]
for i in range(M):
    a, b = map(int, input().split())
    if H[a-1] < H[b-1]:
        ans[a-1] = True
    elif H[a-1] > H[b-1]:
        ans[b-1] = True
    else:
        ans[a-1] = True
        ans[b-1] = True

print(N-sum(ans))
from sys import stdin
N,M= list(map(int,stdin.readline().strip().split()))
H=[int(x) for x in input().split()]
count=[1]*N
for i in range(M):
    A,B=(list(map(int,input().split())))
    if H[A-1]<H[B-1]:
        count[A-1]=0
    elif H[A-1]>H[B-1]:
        count[B-1]=0
    else:
        count[A-1]=0
        count[B-1]=0
print(sum(count))

#print(len(set(road)))
N, M = map(int, input().split())
H = list(map(int, input().split()))
AB = [list(map(int, input().split())) for i in range(M)]

tf_array = [0]*N

for a, b in AB:
    if H[a-1] > H[b-1]:
        tf_array[b-1] += 1
    elif H[a-1] == H[b-1]:
        tf_array[a-1] += 1
        tf_array[b-1] += 1
    else:
        tf_array[a-1] += 1

print(tf_array.count(0))
n,m=map(int,input().split())
List=list(map(int,input().split()))#n個
s=[]

for i in range(m):
    a,b=list(map(int,input().split()))
    if List[a-1]>List[b-1]:
        s.append(b)
    elif List[a-1]<List[b-1]:
        s.append(a)
    else:
        s.append(a)
        s.append(b)
    
t=set(s)       
print(n-len(t))
n,m=map(int,input().split())

h=list(map(int,input().split()))
ans=[0]*n

for i in range(m):
  a,b=map(int,input().split())
  a=a-1
  b=b-1
  if h[a]==h[b]:
    ans[a]+=1
    ans[b]+=1
  elif h[a]>h[b]:
    ans[b]+=1
  else:
    ans[a]+=1
#print(ans)
print(ans.count(0))
n, m = map(int, input().split())

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

tenboudai = [1 for i in range(n)]

for i in range(m):
    a, b = map(int, input().split())
    if hList[a - 1] == hList[b - 1]:
        tenboudai[a - 1] = 0
        tenboudai[b - 1] = 0
    elif hList[a - 1] > hList[b - 1]:
        tenboudai[b - 1] = 0
    else:
        tenboudai[a - 1] = 0

ans = 0
for i in tenboudai:
    if i == 1:
        ans += 1

print(ans)
#n, m, q = map(int, input().split())
#List = list(map(int, input().split()))
n, m = map(int, input().split())
h = list(map(int, input().split()))
ans = [1]*n

for i in range(m):
    a, b = map(int, input().split())
    if h[a - 1] < h[b - 1]:
        ans[a - 1] = 0
    elif h[a - 1] > h[b - 1]:
        ans[b - 1] = 0
    else:
        ans[a - 1] = 0
        ans[b - 1] = 0

print(ans.count(1))
N, M= map(int, input().split())
H = list(map(int, input().split()))
a=[0]*M
b=[0]*M
for i in range(M):
    a[i], b[i]=map(int, input().split())

tenbou=[1]*N

for i in range(M):
    if H[a[i]-1]>H[b[i]-1]:
        tenbou[b[i]-1]=0
    elif H[a[i]-1]<H[b[i]-1]:
        tenbou[a[i]-1]=0
    else:
        tenbou[a[i]-1]=0
        tenbou[b[i]-1]=0

print(sum(tenbou))
(n, m) = list(map(int, input().split()))
hights = list(map(int, input().split()))

bads = set([])
for _ in range(m):
    (s, d) = list(map(int, input().split()))
    if hights[s-1] < hights[d-1]:
        bads.add(s)
    elif hights[s-1] > hights[d-1]:
        bads.add(d)
    elif hights[s-1] == hights[d-1]:
        bads.add(s)
        bads.add(d)
print(len(hights) - len(bads))
N,M=map(int,input().split())
Hs=list(map(int,input().split()))
results=[True]*N
for m in range(M):
    s,e=map(int,input().split())
    if Hs[s-1] <= Hs[e-1]:
        results[s-1] = False
    if Hs[s-1] >= Hs[e-1]:
        results[e-1] = False

print(sum(results))