peterverebics/CodeNet_Python_118 huggingface dataset:
n,m=map(int,input().split())
h =list(map(int,input().split()))
l=[True]*n
for _ in range(m):
    i, j=map(int ,input().split())
    i-=1
    j-=1
    if h[i]-h[j]>0:
      l[j]=False
    elif h[j]-h[i] >0:
      l[i]=False
    else:
      l[i]=False
      l[j]=False
      
print(l.count(True))
N, M = map(int, input().split())
H = list(map(int, input().split()))
G = [[] for _ in range(N)]
for _ in range(M):
  a, b = map(int, input().split())
  a, b = a-1, b-1
  G[a].append(b)
  G[b].append(a)

ans = 0
for i in range(N):
  m = 0
  for g in G[i]:
    m = max(m, H[g])
  if H[i] > m:
    ans += 1

print(ans)
n,m = map(int, input().split())
h = list(map(int, input().split()))
#a = [list(map(int, input().split())) for _ in range(m)]
ans = [1]*n
for i in range(m):
    x,y = map(int, input().split())
    if (h[x-1] > h[y-1]):
        ans[y-1] = 0
    elif (h[x-1] < h[y-1]):
        ans[x-1] = 0
    else:
        ans[x-1] = 0
        ans[y-1] = 0
print(sum(ans))
n, m = map(int, input().split())
h = list(map(int, input().split()))
j = []
sore = [[0] for i in range(n)]
for i in range(m):
    road = list(map(int, input().split()))
    sore[road[0]-1].append(h[road[1]-1])
    sore[road[1]-1].append(h[road[0]-1])
ans = 0
for i in range(n):
    if h[i] > max(sore[i]):
        ans+=1
print(ans)
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())
  A-=1
  B-=1
  if H[A] < H[B]:
    ans[A] *= 0
  elif H[A] > H[B]:
    ans[B] *= 0
  else:
    ans[A] *= 0
    ans[B] *= 0
print(sum(ans))
from collections import defaultdict as d

n, m = map(int, input().split())
h = list(map(int, input().split()))
adj = d(list)
s = set()
for j in range(m):
	a, b = map(int, input().split())
	adj[a].append(b)
	adj[b].append(a)
	s.add(a)
	s.add(b)

res = 0
for i in range(1, n+1):
	if i not in s:
		res += 1
for k, v in adj.items():
	f = 1
	for i in adj[k]:
		if h[k-1] <= h[i-1]:
			f = 0
	if f:
		res += 1
print(res)
import sys

lines = sys.stdin.readlines()

X = lines[0].split(' ')
N = int(X[0])
M = int(X[1])

H = []
Y = []

H=lines[1].split(' ')

for j in range(M):
    A = int(lines[j+2].split(' ')[0])
    B = int(lines[j+2].split(' ')[1])
    if int(H[A-1]) <= int(H[B-1]):      
      Y.append(A-1)
    if int(H[B-1]) <= int(H[A-1]):
      Y.append(B-1)
Z = len(set(Y))
print(N-Z)
inputs = open(0).readlines()
n, m = map(int, inputs[0].split())
*H, = map(int, inputs[1].split())
AB = [map(int, ab.split())for ab in inputs[2:]]

C = [[] for _ in range(n)]
for a, b in AB:
    C[a-1].append(H[b-1])
    C[b-1].append(H[a-1])
ans = 0
for c, h in zip(C, H):
    ans += all(h > x for x in c)
print(ans)
N,M = map(int,input().split())
H = list(map(int,input().split()))

tmp = [1] * N

AB = [map(int, input().split()) for _ in range(M)]
A, B = [list(i) for i in zip(*AB)]      
    
for i in range(M):
  if H[A[i]-1] > H[B[i]-1]:
    tmp[B[i]-1] = 0
  elif H[A[i]-1] < H[B[i]-1]:
    tmp[A[i]-1] = 0
  else:
    tmp[A[i]-1] = 0
    tmp[B[i]-1] = 0

print(sum(tmp))
N, M = map(int, input().split())
H = list(map(int, input().split()))
groups = [[] for _ in range(N)]
for i in range(N):
    groups[i].append(H[i])

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

ans = 0
for i in range(N):
    g = groups[i]
    g.sort(reverse=True)
    if len(g) == 1:
        ans += 1
        continue
    if g[0] != g[1] and g[0] == H[i]:
        ans += 1
print(ans)
n,m=map(int,input().split())
h=list(map(int,input().split()))
l=[list(map(int,input().split())) for i in range(m)]

peaks=[]
for i in range(n):
  peaks.append(1)
  
for i in range(m):
  if h[l[i][0]-1]>h[l[i][1]-1]:
    peaks[l[i][1]-1]=0
  elif h[l[i][0]-1]<h[l[i][1]-1]:
    peaks[l[i][0]-1]=0
  else:
    peaks[l[i][1]-1]=0
    peaks[l[i][0]-1]=0

print(peaks.count(1))
n, m = map(int, input().split())
h = list(map(int, input().split()))
rela = [[] for i in range(n)]
for i in range(m):
    ai, bi = list(map(int, input().split()))
    #ab.append(abi)
    ai -= 1
    bi -= 1
    rela[ai].append(bi)
    rela[bi].append(ai)
    
ans = 0
for i in range(n):
    flag = True
    for j in rela[i]:
        if h[j] >= h[i]:
            flag = False
    if flag:
        ans += 1
print(ans)
N,M = map(int,input().split())
H = list(map(int,input().split()))
high = [1] * N

for i in range(M):
  A,B = map(int,input().split())
  if H[A-1] < H[B-1]:
    high[A-1] = 0
  elif H[A-1] > H[B-1]:
    high[B-1] = 0
  else:
    high[A-1] = 0
    high[B-1] = 0

print(sum(high))
N, M = map(int, input().split())
Hlist = list(map(int, input().split()))
badSign = set()
oldroute = []

for i in range(M):
  nowRoute = list(map(int, input().split()))
  if nowRoute == oldroute:
    badSign.add(nowRoute[0])
    badSign.add(nowRoute[1])
  else:
    if Hlist[nowRoute[0]-1] < Hlist[nowRoute[1]-1]:
      badSign.add(nowRoute[0])
    elif Hlist[nowRoute[0]-1] > Hlist[nowRoute[1]-1]:
      badSign.add(nowRoute[1])
    else:
      badSign.add(nowRoute[0])
      badSign.add(nowRoute[1])
    oldroute = nowRoute
print(N-len(badSign))
n,m = map(int,input().split())
H = list(map(int,input().split()))
L = [1]*n
for _ in range(m):
  a,b = map(int,input().split())
  a -= 1
  b -= 1
  if H[a] == H[b]:
    L[a] = 0
    L[b] = 0
  elif H[a] < H[b]:
    L[a] = 0
  elif H[a] > H[b]:
    L[b] = 0
print(sum(L))
N, M = map(int, input().split())
H = list(map(int, input().split()))
CHECK = [1]*N
for i in range(M):
    A, B = map(int, input().split())
    if H[A-1] > H[B-1]:
        CHECK[B-1] = 0
    elif H[B-1] > H[A-1]:
        CHECK[A-1] = 0
    else:
        CHECK[A-1] = 0
        CHECK[B-1] = 0
print(sum(CHECK))
n, m = map(int, input().split())

l = set()
for i in range(n):
    l.add(i+1)

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

s = set()

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

#    print(s)

ans = list(l - s)
#print(ans)
print(len(ans))
n, m = map(int,input().split())
h = list(map(int,input().split()))
ans = [1]*n #いい展望台のところは1にする
li = []
for i in range(m):
    li.append(list(map(int,input().split())))

for x in li:
    y = h[x[0]-1]
    z = h[x[1]-1]
    if y <= z:
        ans[x[0]-1] = 0
    if z <= y:
        ans[x[1]-1] = 0

print(ans.count(1))
import sys

readline = sys.stdin.readline
readall = sys.stdin.read
ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))
prl = lambda x: print(*x ,sep='\n')

n,m = nm()
h = nl()

res = [[i] for i in h]

for i in range(m):
    a,b = nm()
    res[a-1].append(h[b-1])
    res[b-1].append(h[a-1])

ans = 0
for j in res:
    ma = max(j)
    if j.count(ma) == 1 and j[0] == ma:
        ans += 1

print(ans)
n,m=map(int,input().split())
h=list(map(int,input().split()))
edge=[]
for i in range(n):
    edge.append([])
for i in range(m):
    a,b=map(int,input().split())
    edge[a-1].append(b-1)
    edge[b-1].append(a-1)
c=0
for i in range(n):
    f=1
    for j in range(len(edge[i])):
        if h[edge[i][j]]>=h[i]:
            f=0
    c+=f
print(c)
n,m=map(int,input().split())
h=[int(x) for x in input().split()]
gd=[1]*n
for i in range(m):
  a,b=[int(x)-1 for x in input().split()]
  if h[a] >= h[b]:
    gd[b]=0
  if h[a] <= h[b]:
    gd[a]=0
print(sum(gd))
N,M,*HAB=map(int,open(0).read().split())
H,AB=[0]+HAB[:N],HAB[N:]
good=[False]+[True]*N
for a,b in zip(*[iter(AB)]*2):
  if H[a]>=H[b]:
    good[b]=False
  if H[b]>=H[a]:
    good[a]=False
print(sum(good))
n, m = map(int,input().split())
h = list(map(int,input().split()))

ab = [list(map(int,input().split())) for _ in range(m)]


point = [0]*n
app = [0]*n
cnt = []

for i in ab:
    app[i[0]-1] += 1
    app[i[1]-1] += 1
    if h[i[0]-1] > h[i[1]-1]:
        point[i[0]-1] += 1
    elif h[i[0]-1] < h[i[1]-1]:
        point[i[1]-1] += 1
for i in range(n):
    if app[i] == point[i]:
        cnt.append(i+1)
print(len(cnt))
n,m = map(int,input().split())
h = list(map(int,input().split()))
ans = []
for i in range(n):
  ans.append(1)
for i in range(m):
  a,b = map(int,input().split())
  if(h[a-1]>h[b-1]):
    if(ans[b-1]==1):
      ans[b-1]-=1
  elif(h[b-1]>h[a-1]):
    if(ans[a-1]==1):
      ans[a-1]-=1
  else:
    ans[a-1]-=1
    ans[b-1]-=1
anss = 0
for i in range(n):
  if(ans[i]==1):
    anss+=ans[i]
print(anss)
n, m = map(int, input().split())
l = list(map(int, input().split()))
cor = [[] for i in range(n)]

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

ans = 0
for i in range(n):
    max_h = l[i]
    cnt = 1
    co = list(set(cor[i]))
    for j in range(len(co)):
        if l[co[j]] >= max_h:
            cnt = 0
            break
    ans += cnt

print(ans)
n,m = map(int,input().split())
h = list(map(int,input().split()))
judge = [True] * n

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

print(judge.count(True))
n,m = map(int,input().split())
h = list(map(int,input().split()))
edge =  [[] for _ in range(n)]
ans = 0
for i in range(m):
    a,b = map(int,input().split())
    edge[a-1].append(h[b-1])
    edge[b-1].append(h[a-1])
for j in range(n):
    if edge[j]==[] or h[j]>max(edge[j]):
        ans += 1
    
print(ans)
import sys
sys.setrecursionlimit(10000000)
from collections import defaultdict

N, M = map(int, input().split())
h = list(map(int, input().split()))
flg = [1]*N
for i in range(M):
    a, b = map(lambda x : int(x)-1, input().split())
    if h[a] <= h[b]:
        flg[a] = 0
    if h[b] <= h[a]:
        flg[b] = 0
print(sum(flg))
N, M = map(int,input().split())
H = list(map(int, input().split()))

C = [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]:
    C[B] = 0
  if H[A] <= H[B]:
    C[A] = 0
  #print(C)
    
print(sum(C))
N, M = (int(x) for x in input().split())
H = [int(x) for x in input().split()]
#AB = []
Nn = []
for i in range(1,N+1):
  Nn.append(i)
for i in range(M):
  A,B = (int(x) for x in input().split())
  if H[A-1] == H[B-1]:
      Nn[A-1] = 0
      Nn[B-1] = 0
  elif H[A-1] > H[B-1]:
      Nn[B-1] = 0
  else:
      Nn[A-1] = 0
n = set(Nn)
n.remove(0)
print(len(n))
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())
 
 
S=[1]*N
 
 
for m in range(M):
  if H[A[m]-1] == H[B[m]-1]:
    S[A[m]-1] = 0
    S[B[m]-1] = 0
  elif H[A[m]-1] <= H[B[m]-1]:
    S[A[m]-1] = 0
  elif H[A[m]-1] >= H[B[m]-1]:
    S[B[m]-1] = 0
 
 
print(sum(S))
import numpy as np
N, M = map(int, input().split())
H = list(map(int, input().split()))
yoi = np.ones(N)
for i in range(M):
    A, B = map(int, input().split())
    if H[A-1] > H[B-1]:
        yoi[B-1] = 0
    elif H[B-1] > H[A-1]:
        yoi[A-1] = 0
    elif H[A-1]==H[B-1]:
        yoi[A-1] = 0
        yoi[B-1] = 0
print(int(np.sum(yoi)))
n, m = map(int, input().split())
h = list(map(int, input().split()))
h2 = [0] * n

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

ans = 0
for i in range(n):
    if h[i] > h2[i]:
        ans += 1

print(ans)
import collections

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())

z = zip(a,b)
lis = [0]*n

for i,j in z:

    if h[i-1] > h[j-1]:
        lis[j-1] = 1
    elif h[i-1] < h[j-1]:
        lis[i-1] = 1
    else:
        lis[i-1]=1
        lis[j-1]=1

print(collections.Counter(lis)[0])
import numpy as np
# coding: utf-8
# Your code here!
N, M = map(int, input().split())
#S = input()

H = list(map(int, input().split()))
path_list = [[0] for _ in range(N)]

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

path_max = [np.max(path_list[i]) for i in range(N)]
H = np.array(H)

#print(H)
#print(path_max)
print(len(H)-len(H[H<=path_max]))
n,m = map(int,input().split())
h = list(map(int,input().split()))
a = [0 for i in range(m)]
b = [0 for i in range(m)]
for i in range(m):
	a[i],b[i] = map(int,input().split())
#良い展望台 -> 標高の一番高い
v = [[] for i in range(n)]
for i in range(m):
	v[a[i]-1].append(b[i]-1)
	v[b[i]-1].append(a[i]-1)
count = 0
for i in range(n):
	max = h[i]
	cnt = h[i]
	unta = 1
	for j in v[i]:
		cnt = h[j]
		if max <= cnt:
			max = cnt
			unta = 0
	count += unta
print(count)
N,M=map(int,input().split())
H=list(map(int,input().split()))
graph=[[] for _ in range(N)]
for i in range(M):
	A,B=map(int,input().split())
	graph[A-1].append(B)
	graph[B-1].append(A)
answer=0
for i in range(N):
	count=0
	for j in graph[i]:
		if H[i]<=H[j-1]:
			count+=1
			break
	if count==0:
		answer+=1
print(answer)
n, m = map(int, input().split())
h = list(map(int, input().split()))
a = [list(map(int, input().split())) for i in range(m)]
s = [0 for i in range(n)]
for i in range(m):
    if h[a[i][0]-1] <= h[a[i][1]-1]:
        s[a[i][0]-1] = 1
    if h[a[i][0]-1] >= h[a[i][1]-1]:
        s[a[i][1]-1] = 1
ans = n - sum(s)
print(ans)
import sys
input = sys.stdin.readline
N,M = map(int,input().split())
#低いやつを引いていく感じ
Hlist = list(int(x) for x in input().split())

flag = [1]*N

for i in range(M):
    A,B = map(int, input().split())
    A -= 1
    B -= 1
    if(Hlist[A] == Hlist[B]) :
        flag[A] = 0
        flag[B] = 0
    elif(Hlist[A] > Hlist[B]) :
        flag[B] = 0
    else :
        flag[A] = 0
print(sum(flag))
N,M =list(map(int,input().split()))
H = list(map(int,input().split()))

h = [0] * N 
ans = 0
for i in range(M):
    A,B = list(map(int,input().split()))
    h[A-1] = max(H[B-1],h[A-1])
    h[B-1] = max(H[A-1],h[B-1])

for i in range(N):
    if H[i] >h[i] or h[i] == 0:
        ans += 1
print(ans)
n, m = map(int, input().split())
h = list(map(int, input().split()))
h2 = [0]*n
a = [0]*m
b = [0]*m
for i in range(m):
    a[i], b[i] = map(int, input().split())
for j in range(m):
    if h[a[j]-1] < h[b[j]-1]:
        h2[a[j]-1] = 1
    elif h[a[j]-1] > h[b[j]-1]:
        h2[b[j]-1] = 1
    else:
        h2[a[j]-1] = 1
        h2[b[j]-1] = 1

print(h2.count(0))
n, m = map(int ,input().split())
h = list(map(int, input().split()))
lis = [[] for i in range(n)]
for i in range(m):
    a,b = map(int ,input().split())
    a -= 1
    b -= 1
    lis[a].append(b)
    lis[b].append(a)
#print(lis)
ans = 0
for i in range(n):
    flg = True
    val = h[i]
    for j in range(len(lis[i])):
        if val <= h[lis[i][j]]:
            flg = False
    if flg == True:
        ans += 1
        #print(i)
print(ans)
import sys
n, m = map(int, sys.stdin.readline().split())
li = list(map(int, sys.stdin.readline().split()))
li2 = ['a']*n
for _ in range(m):
  i, k = map(int, sys.stdin.readline().split())
  k -= 1
  i -= 1
  if li[k] - li[i] > 0:
    li2[i] = 'F'
    if li2[k] == 'a':
      li2[k] = 'T'
  elif li[k] == li[i]:
    li2[i] = 'F'
    li2[k] = 'F'
  else:
    li2[k] = 'F'
    if li2[i] == 'a':
      li2[i] = 'T'
print(n-li2.count('F'))
N, M = 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 = map(int,input().split())
H = list(map(int,input().split()))
B = []
for i in range(M):
  a,b = map(int,input().split())
  if H[a-1] < H[b-1]:
    B += [a]
  elif H[a-1] == H[b-1]:
    B += [a,b]
  elif H[a-1] > H[b-1]:
    B += [b]
C = set(B)

print(N - len(C))
N, M = list(map(int, input().split()))
H = list(map(int, input().split()))

ans = [1] * N

for i in range(M):
    A, B = list(map(int, input().split()))
    A -= 1
    B -= 1
    if H[A] > H[B]:
        ans[B] = 0
    elif H[A] < H[B]:
        ans[A] = 0
    else:
        ans[A] = 0
        ans[B] = 0
print(ans.count(1))
n , m = map(int,input().split())

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

roadssta = []
roadsfin = []

ten = [1]*n

for i in range(m):
    base = input().split()
    a = int(base[0])
    b = int(base[1])
    if hyoukou[a-1]>hyoukou[b-1]:
        ten[b-1] = 0
    elif hyoukou[a-1]<hyoukou[b-1]:
        ten[a-1] = 0
    else:
        ten[a-1] = 0
        ten[b-1] = 0

print(ten.count(1))
n,m = map(int,input().split())
h = list(map(int,input().split()))

ma =[0] * n

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

ans = 0
for i in range(n):
  if ma[i] < h[i] :
    ans += 1

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

ans=list(range(n))

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

print(sum([j>=0 for j in ans]))
N, M = map(int, input().split())
H = list(map(int, input().split()))
H_memo = [1]*N
for _ in range(M):
    Ai, Bi = map(int, input().split())
    if H[Ai-1] > H[Bi-1]:
        H_memo[Bi-1] = 0
    elif H[Ai-1] < H[Bi-1]:
        H_memo[Ai-1] = 0
    else:
        H_memo[Bi-1] = 0
        H_memo[Ai-1] = 0
print(sum(H_memo))
n,m = map(int,input().split())
ls = list(map(int,input().split()))
pos = [1]*(n)
for i in range(m):
    a,b = map(int,input().split())
    if ls[a-1] > ls[b-1]:
        pos[b-1] = 0
    elif ls[a-1] < ls[b-1]:
        pos[a-1] = 0
    else:
        pos[a-1] = 0
        pos[b-1] = 0
print(sum(pos))
n,m=map(int,input().split())
h=[0]*n
r=[1]*n
h[:]=map(int,input().split())
for ii in range(m):
  a,b=map(lambda x: int(x)-1,input().split())
  if h[a]>=h[b]:
    r[b]=0
  if h[b]>=h[a]:
    r[a]=0
print(sum(r))
n,m = map(int,input().split())
h = list(map(int,input().split()))
l = [0]*n

for i in range(m):
    a,b = map(int,input().split())
    if h[a-1] < h[b-1]:
        l[a-1] = -1
    elif h[a-1] > h[b-1]:
        l[b-1] = -1
    elif h[a-1] == h[b-1]:
        l[a-1] = -1
        l[b-1] = -1
print(l.count(0))
def check(a, b, H, L):


	if H[a - 1] <= H[b - 1]:
			L[a - 1] = 0
	if H[b - 1] <= H[a - 1]:
			L[b - 1] = 0
	
n, m = map(int, input().split())
H = list(map(int, input().split()))
L = [i for i in range(1, n + 1)]
count = 0
for _ in range(m):
	a, b = map(int, input().split())
	check(a, b, H, L)

for i in L:
	if i != 0:
		count += 1
print(count)
#!/usr/bin/env python3

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

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


ans = 0
for i in range(n):
    tmp = high[i]
    flg = True
    for nxt in graph[i]:
        if high[nxt] >= tmp:
            flg = False
            break
    if flg:
        ans += 1

print(ans)
N,M = map(int, input().split())
H = list(map(int, input().split()))
AB = [list(map(int, input().split())) for _ in range(M)]

good = [True]*N
for ab in AB:
    a, b = ab[0]-1, ab[1]-1
    if H[a] >= H[b]:
        good[b] = False
    if H[b] >= H[a]:
        good[a] = False

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


ans = [1] * n
for _ in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    if hs[a] < hs[b]:
        ans[a] = 0
    elif hs[a] == hs[b]:
        ans[a] = 0
        ans[b] = 0
    else:
        ans[b] = 0

print(sum(ans))
N, M = map(int, input().split())
H = list(map(int, input().split()))
Height = []
Good = []
for i in range(N):
    Height.append(H[i])
    Good.append(0)
for i in range(M):
    A, B = map(int, input().split())
    if Height[A - 1] < Height[B - 1]:
        Good[A - 1] = 1
    elif Height[A - 1] > Height[B - 1]:
        Good[B - 1] = 1
    else:
        Good[A - 1] = 1
        Good[B - 1] = 1
n = 0
for i in range(N):
    if Good[i] == 0:
        n += 1
print(n)
f=lambda:map(int,input().split())
N,M=f()
*H,=f()

g = [[] for _ in range(N)]
    
for _ in range(M):
 a,b=f()
 g[a-1].append(b-1)
 g[b-1].append(a-1)
print(sum(all(H[j]<H[i]  for j in g[i]) for i in range(N)))
def main():
  N, M = map(int, input().split())
  H_l = list(map(int, input().split()))
  best_l = [1] * N
  for i in range(M):
    x_1, y_1 = map(int, input().split())
    x = x_1 - 1
    y = y_1 - 1
    if H_l[x] > H_l[y]:
      best_l[y] = 0
    elif H_l[x] < H_l[y]:
      best_l[x] = 0
    else:
      best_l[x] = 0
      best_l[y] = 0
  print(sum(best_l))
main()
N, M = map(int, input().split())
H = list(map(int, input().split()))
A_to_B = [0]*N
for _ in range(M):
    tmp = list(map(int, input().split()))
    if A_to_B[tmp[0]-1] < H[tmp[1]-1]:
        A_to_B[tmp[0]-1] = H[tmp[1]-1]

    if A_to_B[tmp[1]-1] < H[tmp[0]-1]:
        A_to_B[tmp[1]-1] = H[tmp[0]-1]

ans = 0
for i in range(N):
    if H[i] > A_to_B[i]:
        ans += 1
print(ans)
N, M= map(int, input().split())
H = list(map(int, input().split()))

l = H.copy()
for i in range(M):
  A, B = map(int, input().split())
  if H[A-1] > H[B-1]:
    l[B-1] = 0
  elif H[B-1] > H[A-1]:
    l[A-1] = 0
  elif H[A-1] == H[B-1]:
    l[A-1] = 0
    l[B-1] = 0
print(N - l.count(0))
from collections import deque

N,M = map(int,input().split())
H = [0] + [int(i) for i in input().split()]

data = [list(map(int,input().split())) for i in range(M)]

G = {}

for i in range(1,N+1):
    G[i] = []
for i in range(M):
    G[data[i][0]].append(data[i][1])
    G[data[i][1]].append(data[i][0])

ans = 0
for i in range(1,N+1):
    for j in G[i]:
        if H[i] > H[j]:
            continue
        else:
            break
    else:
        ans += 1

print(ans)
n, m = map(int, input().split())
a = list(map(int, input().split()))
ans = [True] * n
for _ in range(m):
    aj, bj = map(int, input().split())
    aj -= 1
    bj -= 1
    if a[aj] <= a[bj]:
        ans[aj] = False
    if a[bj] <= a[aj]:
        ans[bj] = False

print(ans.count(True))
n, m = map(int, input().split())
h = list(map(int, input().split()))
ans = [1]*n

for i in range(m):
    ai, bi = map(int, input().split())
    if h[ai-1] >= h[bi-1]:
        ans[bi-1] = 0
    if h[ai-1] <= h[bi-1]:
        ans[ai-1] = 0
print(sum(ans))
N, M = map(int, input().split())
l = input().split()
n = list()
H = list()
for i in range(N):
  H.append(int(l[i]))
  n.append(int(l[i]))
for i in range(M):
  Ai, Bi = map(int,input().split())
  if H[Ai-1] > H[Bi-1]:
    n[Bi-1] = 0
  elif H[Ai-1] < H[Bi-1]:
    n[Ai-1] = 0
  else:
    n[Bi-1] = 0
    n[Ai-1] = 0
r = 0
for i in range(N):
  if n[i] != 0:
    r += 1
print(r)
n, m = map(int, input().split())

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

ans = [True]*n

for i in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1

    if h[a] <= h[b]:
        ans[a] = False
    if h[a] >= h[b]:
        ans[b] = False

print(sum(ans))
n,m = list(map(int, input().split()))
height_list = list(map(int, input().split()))
l=[1]*n
for i in range(m):
    a,b = map(int,input().split())
    if height_list[a-1] > height_list[b-1]:
        l[b-1] =0
    elif height_list[a-1] < height_list[b-1]:
        l[a-1]= 0
    else:
        l[a-1]=l[b-1] =0
print(sum(l))
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n, m = map(int, readline().split())
h = [0] + list(map(int, readline().split()))
ab = [list(map(int, readline().split())) for _ in range(m)]
check = [True] * (n + 1)
for a, b in ab:
    if h[a] > h[b]:
        check[b] = False
    elif h[a] < h[b]:
        check[a] = False
    else:
        check[a] = False
        check[b] = False
print(check.count(True) - 1)