peterverebics/CodeNet_Python_118 huggingface dataset:
N,M=map(int, input().split())
H=list(map(int,input().split()))
List=[list(map(int,input().split())) for i in range(M)]

sup_list=[1 for i in range(N)]

for j in range(M):
    if H[List[j][0]-1]>H[List[j][1]-1]:
        sup_list[List[j][1]-1]=0
    elif H[List[j][0]-1]==H[List[j][1]-1]:
        sup_list[List[j][0]-1]=0
        sup_list[List[j][1]-1]=0
    else:
        sup_list[List[j][0]-1]=0


print(sum(sup_list))
n, m = map(int, input().split())
H = list(map(int, input().split()))
query = [tuple(map(int, input().split())) for _ in range(m)]

table = [0 for _ in range(n)]

for a, b in query:
    if H[a-1] > H[b-1]:
        table[b-1] += 1
    elif H[a-1] < H[b-1]:
        table[a-1] += 1
    else:
        table[a-1] += 1
        table[b-1] += 1

ans = 0
for i in table:
    if i == 0:
        ans += 1
print(ans)
import numpy as np
n,m = map(int,input().split())
h = list(map(int,input().split()))

base = np.ones(n)

for i in range(m):
  a,b =  map(int,input().split())
  if h[a-1] > h[b-1]:
    base[b-1] = 0
  elif h[a-1] < h[b-1]:
    base[a-1] = 0
  elif h[a-1] == h[b-1]:
    base[a-1] = 0
    base[b-1] = 0
    
print(int(np.sum(base)))
NM = list(map(int, input().split()))
N = NM[0]
M = NM[1]
heightlst = list(map(int, input().split()))
roadlst = list()
for _ in range(M):
	roadlst.append(list(map(int, input().split())))
allroad = [[] for _ in range(N)]

for v in roadlst:
	allroad[v[0] - 1].append(v[1] - 1)
	allroad[v[1] - 1].append(v[0] - 1)

ans = 0
for i in range(N):
	flag = 0
	for v in allroad[i]:
		if heightlst[v] < heightlst[i]:
			flag += 1
	if flag == len(allroad[i]):
		ans += 1
print(ans)
def main():
    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())
        if h[a-1]>h[b-1]:
            ans[b-1]=0
        elif h[a-1]==h[b-1]:
            ans[a-1]=ans[b-1]=0
        else:
            ans[a-1]=0
    print(sum(ans))


if __name__ == "__main__":
    main()
n, m = [int(_) for _ in input().split()]
h = [int(_) for _ in input().split()]
l = [[] for i in range(n)]
for i in range(m):
    a, b = [int(_) for _ in input().split()]
    l[a-1].append(b-1)
    l[b-1].append(a-1)
ans = 0
for i in range(n):
    high = h[i]
    p = l[i]
    flag = 0
    for j in range(len(p)):
        if h[p[j]] >= high:
            flag = 1
    if flag == 0:
        ans += 1
print(ans)
n,m = map(int, input().split())
H = list(map(int, input().split()))
s = [[0] for i in range(n)]
for i in range(m):
    a, b = map(int, input().split())
    s[a-1].append(H[b-1])
    s[b-1].append(H[a-1])
c = 0
for j in range(n):
    if H[j] > max(s[j]):
        c+= 1
print(c)
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())
    A -= 1
    B -= 1
    ma[A] = max(ma[A], H[B])
    ma[B] = max(ma[B], H[A])

ans = 0
for i in range(N):
    if H[i] > ma[i]:
        ans += 1

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

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

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

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

for i in range(M):
  a, b = map(int, input().split())
  a -= 1
  b -= 1
  if Hl[a] > Hl[b]:
    al.append(b+1)
  elif Hl[a] < Hl[b]:
    al.append(a+1)
  else:
    al.extend([a+1,b+1])

al = set(al)
print(len(Hl) - len(al))
# coding: utf-8


def solve(*args: str) -> str:
    n, m = map(int, args[0].split())
    H = [0]+list(map(int, args[1].split()))
    AB = [tuple(map(int, ab.split())) for ab in args[2:]]

    G = [True]*(n+1)
    for a, b in AB:
        G[a] &= H[b] < H[a]
        G[b] &= H[a] < H[b]

    return str(sum(G[1:]))


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))
N,M = map(int,input().split())
H = list(map(int,input().split()))
AB = [list(map(int,input().split())) for _ in range(M)]
A = [list() for _ in range(N)] 
ans = 0  
for a ,b in AB:
    A[b-1].append(a-1)
    A[a-1].append(b-1)
for i in range(N):
    for j in A[i]:
        #満たさないものを数える
        if H[i] <= H[j]:
            ans += 1
            break
print(N-ans)
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())
    if H[a - 1] > H[b - 1]:
        ans[b - 1] = False

    elif H[a - 1] < H[b - 1]:
        ans[a - 1] = False
    else:
        ans[a - 1], ans[b - 1] = False, False
        
print(sum(ans))
# input
N, M = map(int, input().split())
H = list(map(int, input().split()))
L = [[] for _ in range(N)]
for _ in range(M):
    a, b = map(int, input().split())
    L[a-1].append(H[b-1])
    L[b-1].append(H[a-1])

# process
ans = 0
for i, l in enumerate(L):
    if [x for x in l if x >= H[i]] == []:
        ans += 1

# output
print(ans)
n, m = map(int, input().split())
h = list(map(int, input().split()))
lis = [1] * n
for i in range(m):
    a, b = map(int, input().split())
    h[a-1]
    h[b-1]

    if h[a-1] < h[b-1]:
        lis[a-1] = 0
    elif h[a-1] > h[b-1]:
        lis[b-1] = 0
    else:
        lis[a-1]=0
        lis[b-1]=0

print(len([i for i in lis if i == 1]))
n, m = map(int, input().split())
h = list(map(int, input().split()))

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

cnt = 0
for i in range(n):
	if ary[i] == 0 and chk[i] == True:
		cnt += 1
print (cnt)
from sys import stdin
N,M= list(map(int,stdin.readline().strip().split()))
H=[int(x) for x in input().split()]
road=[]
hig=[]
ans=[]
kari=[]
count=[0]*N
for i in range(M):
    road.append(max(list(map(int,input().split()))))
print(len(set(road)))
n, m = map(int, input().split())
h = list(map(int, input().split()))
ab = [[] for _ in range(n)]
check = [False for _ in range(n)]
for i in range(m):
  a, b = map(int, input().split())
  ab[a-1].append(b)
  ab[b-1].append(a)

for j in range(n):
  for k in ab[j]:
    if k < h[j]:
      check[j] = True
    else:
      check[j] = False

print(check.count(True))
n,m = map(int,input().split())

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

rank_hlist = sorted(hlist)
rank_dict = dict()
for i in range(n):
    rank_dict[rank_hlist[i]] = i
    
ab_list = []
for i in range(m):
    a, b = map(int,input().split())
    if rank_dict[hlist[a-1]] < rank_dict[hlist[b-1]]:
        a,b = b,a
    ab_list.append([a,b])

good_n = [1]*n

ab_list.sort(key=lambda x:x[0], reverse=True)

for i in range(m):
    ab = ab_list[i]
    good_n[ab[1]-1] = 0

print(good_n.count(1))
N,M= list(map(int , input().split()))
H = list(map(int , input().split()))
A = []
B = []
for i in range(M):
    x,y=[int(i) for i in input().split()]
    A.append(x)
    B.append(y)
S = []
for j in range (M):
    if H[A[j]-1] > H[B[j]-1]:
        S.append(B[j])        
    elif H[A[j]-1] < H[B[j]-1]:
        S.append(A[j])  
S = set(S)
print(N - len(S))
from sys import stdin
N,M= list(map(int,stdin.readline().strip().split()))
H=[int(x) for x in input().split()]
road=[]
hig=[-1]*N
ans=[]
kari=[]
count=[0]*N
for i in range(M):
    road.append(list(map(int,input().split())))
for i,j in road:
    hig[i-1]=max(i,j)
    hig[j-1]=max(i,j)
if -1 in hig:
    print(len(set(hig))-1)
else:print(len(set(hig)))

#print(len(set(road)))
n, m = map(int, input().split())
h = list(map(int, input().split()))
lis = [1] * n
for i in range(m):
    a, b = map(int, input().split())
    h[a-1]
    h[b-1]

    if h[a-1] < h[b-1]:
        lis[a-1] = 0
        h[a-1] = h[b-1]
    elif h[a-1] > h[b-1]:
        lis[b-1] = 0
        h[b-1] = h[a-1]
    else:
        lis[a-1]=0
        lis[b-1]=0

print(len([i for i in lis if i == 1]))
N, M = map(int, input().split())
H = list(map(int, input().split()))
R = list(range(1, N+1))
l = []
for i in range(M):
    A, B = map(int, input().split())
    if H[A-1]< H[B-1]:
        l.append(A)
    else:
        l.append(B)
ans = set(R) - set(l)
print(len(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

print(sum(ans))
def main():
    N, M = map(int, input().split())
    H = list(map(int, input().split()))
    S = [list(map(int, input(_).split())) for _ in range(M)]
    #LIST = [1] * N
    LIST = [ 1 for _ in range(N)]
    for A, B in S:
        if H[A-1] >= H[B-1]: LIST[B-1] = 0
        if H[A-1] <= H[B-1]: LIST[A-1] = 0
#        if H[A-1] == H[B-1]:
#            LIST[B - 1] = 0
#            LIST[A - 1] = 0
    print(sum(LIST))

main()
N,M = map(int,input().split())
H = list(map(int,input().split()))
datas = []
anss = []
for i in range(M):
    datas.append(list(map(int,input().split())))
for data in datas:
    ans = []
    for dat in data:
        ans.append(H[dat-1]) 
    anss.append(max(ans))
print(len(set(anss)))
import numpy as np
N, M = map(int, input().split(' '))

height = np.array(list(map(int, input().split(' '))))
#height_all = height

for i in range(M):
  a, b = map(int, input().split(' '))
  #print(a, b, height[a - 1], height[b - 1])
  if height[a - 1] > height[b - 1]:
    height[b - 1] = 0
   
  else:
    height[a - 1] = 0
  
print(len(np.nonzero(height)))
input1 = input().rstrip().split(" ")
h = input().rstrip().split(" ")
yoi = [1 for i in range(int(input1[0]))]
root =  [input().rstrip().split(" ") for i in range(int(input1[1]))]
for i in range(int(input1[1])):
    a=int(root[i][0])-1
    b=int(root[i][1])-1
    if h[a]> h[b]:
        yoi[b] = 0
    elif h[a] < h[b]:
        yoi[a] = 0
    else:
        yoi[a] = 0
        yoi[b] = 0
print (sum(yoi))
n, m = map(int, input().split())
h = []
h = list(map(int, input().split()))
ans = [0]*n
for i in range(m):
  a, b = map(int, input().split())
  if h[a-1] > h[b-1]:
    ans[b-1] = 1
  if h[a-1] < h[b-1]:
    ans[a-1] = 1
  else:
    ans[a-1] = 1
    ans[b-1] = 1

print(ans.count(0))
N, M = map(int, input().split())

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

good_H = [1] * N

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

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

dic = {}
for i in range(M):
    A, B = map(int,input().split())
    H_max = max(H[A-1],H[B-1])
    H_min = min(H[A-1],H[B-1])
    if H_max in dic.keys():
        dic[H_max] += 1
    elif not(H[A-1] == H[B-1]):
        dic[H_max] = 1
    if H_min in dic.keys() and not(H_max == H_min):
        del dic[H_min]

print(len(dic.keys()))
N,M = map(int,input().split())
H = list(map(int,input().split()))
A_B = [list(map(int, input().split())) for _ in range(M)]

H_list = []
ans = []

for t in A_B:
  T = []
  T1 = T.append(H[t[0]-1])
  T2 = T.append(H[t[1]-1])
  H_list.append(T)
  if T[0] == T[1]:
    continue
  elif T[0] > T[1]:
    ans.append(T[0])
  else:
    ans.append(T[1])

H_list2 = list(set(sum(H_list,[])))
H_last = list(set(H_list2)^set(H))
if H_last != []:
  ans.append(H_last[0])
else:
  pass
print(len(set(ans)))
n,m=map(int,input().split())
hill=list(range(1,n+1))
l=list(map(int,input().split()))
d={}
for i in range(n):
  d[i+1]=l[i]

for i in range(m):
  a,b=map(int,input().split())
  if d[a]>d[b]:
    if b in hill:
      hill.remove(b)
  if d[a]<d[b]:
    if a in hill:
      hill.remove(a)
  else:
    if a in hill:
      hill.remove(a)
    if b in hill:
      hill.remove(b)

print(len(hill))
n,m = map(int,input().split())
h = list(map(int,input().split()))
tenbo = [list(map(int,input().split())) for _ in range(m)]
#print(tenbo)
tree = [[0]for _ in range(n)]
for i in range(m):

	x = tenbo[i]
	x1 = x[0]
	x2 = x[1]
	#print(x1)
	y1 = h[x1-1]
	y2 = h[x2-1]
	a = [y1,y2]
	#print(x[1])
	tree[x[0]-1].extend(a)
	tree[x[1]-1].extend(a)
c = 0
for i in range(n):
	if max(tree[i]) <=h[i]:
		if len(tree[i]) > 1:
		#print(max(tree[i]))
			c += 1
print(c)
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[b-1]>H[a-1]:
        ans[b-1] = 0
    else:
        ans[a-1], ans[b-1] = 0, 0
print(sum(ans))
import sys
import collections
import itertools
import numpy as np

n,m = map(int, input().split())
al = np.ones(n,dtype="int8")
H = list(map(int, input().split()))
AB=[]

for i in range(m):
    AB.append(tuple(map(int, input().split())))

for t in range(m):
    A = AB[t][0]
    B = AB[t][1]
	
    bou1 = H[A-1]
    bou2 = H[B-1]
    if bou1<bou2:
        al[A-1] = al[A-1]-1
    elif bou2<bou1:
        al[B-1] = al[B-1]-1

print(np.count_nonzero(al>0))
n,m = map(int,input().split())
h = list(map(int,input().split()))
ans = [1]*n
for i in range(m):
    print(ans)
    a,b = map(int,input().split())
    if h[a-1]>h[b-1]:
        ans[b-1] = 0
    elif h[b-1]>h[a-1]:
        ans[a-1] = 0
    else:
        print("a")
        ans[a-1] = 0
        ans[b-1] = 0
print(ans.count(1))
n, m = map(int, input().split())
h = list(map(int, input().split()))
ab = [list(map(int, input().split())) for i in range(m)]
for i in range(m):
  h[min(ab[i][0]-1, ab[i][1]-1)] = 0
  if h[ab[i][0]-1] == h[ab[i][1]-1]: h[ab[i][0]-1] = h[ab[i][1]-1] = 0
h = [i for i in h if i != 0]
print(len(h))
n,m = map(int,input().split(' '))
h = list(map(int,input().split(' ')))
ansList = [1]*n
numlist = []

for i in range(m):
    a,b = map(int, input().split())
    if h[a-1] > h[b-1]:
        #ansList[a-1] = ma
        numlist.append(b-1)
    else:
        numlist.append(a-1)
for i in list(set(numlist)):
    ansList[i] = 0
print(ansList.count(1))
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[b-1] = 0
  else:
    good[a-1] = 0
    good[b-1] = 0
    
c = collections.Counter(good)
print(c[1])
N,M=map(int,input().split())
H=list(map(int,input().split()))
AB=[]
for i in range(M):
    AB.append(list(map(int,input().split())))

J=[0]*N
for i in range(M):
    if H[AB[i][0]-1]<=H[AB[i][1]-1]:
        J[AB[i][0]-1]+=1
    else:
        J[AB[i][1]-1]+=1
c=0
for i in J:
    if i == 0:
        c+=1

print(c)
def abc166_c():
  n, m = map(int, input().split())
  H = list(map(int, input().split()))
  path = dict([(i, []) for i in range(n)])
  for _ in range(m):
    a, b = map(int, input().split())
    path[a-1].append(b-1)
    path[b-1].append(a-1)

  ans = 0
  for i in range(n):
    my_h = H[i-1]
    if len(path[i]) == 0:
      ans += 1
    else:
      adj_h = [H[j] for j in path[i]]
      if my_h > max(adj_h):
        ans += 1

  print(ans)

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

goodObservatory = [1]*N
goodObservatoryCount = 0

H = input().split()

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


for i in range(N):
	if goodObservatory[i] == 1:
		goodObservatoryCount += 1

print(goodObservatoryCount)
[n,m] = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]
table = [[0]*n for i in range(n)]
ls = [1] * n
for i in range(m):
    [a,b] = [int(i)-1 for i in input().split()]
    if h[a] < h[b]:
        ls[a] = 0
    else:
        ls[b] = 0
print(sum(ls))
#print(ls)
(N,M)=input().split()
(N,M)=(int(N),int(M))
H=list(map(int, input().split()))
Bad=[]
AB=list(range(M))
for i in range(M):
  AB[i]=list(map(int, input().split()))
  if H[AB[i][0]-1] > H[AB[i][1]-1]:
    Bad.append(H[AB[i][1]-1])
  elif H[AB[i][0]-1] < H[AB[i][1]-1]:
    Bad.append(H[AB[i][0]-1])
for i in range(len(Bad)):
  if Bad[i] in H:
    H.remove(Bad[i])
print(len(H))
N,M=list(map(int,input().split()))
H=list(map(int,input().split()))
A=[list(map(int,input().split())) for i in range(M)]

B=[0]*N
# from functools import lru_cache
# @lru_cache(maxsize=1000)
# def yapoos()
for i in A:
    if H[i[0]-1]>H[i[1]-1]:
        B[i[0]-1]=1
    elif H[i[0]-1]<H[i[1]-1]:
        B[i[1]-1]=1
print(B.count(0))
NM =input().split()
N = int(NM[0])
M = int(NM[1])
H = input().split()
Nout = [1] * N
for i in range(M):
	road = input().split()
	if float(H[int(road[0]) - 1]) < float(H[int(road[1]) - 1]):
		Nout[int(road[0]) - 1] = 0
	else:
		Nout[int(road[1]) - 1] = 0
def calc():
	j = 0
	for i in Nout:
		j += i
	return j
print(calc())
n, m = map(int, input().rstrip().split())
hl = [int(v) for v in input().rstrip().split()]
goods = [ 1 for _ in range(n)]
for i in range(m):
    a, b = map(int, input().rstrip().split())
    a -= 1
    b -= 1
    if hl[a] < hl[b]:
        hl[a] = hl[b]
        goods[a] = 0
    elif  hl[a] > hl[b]:
        hl[b] = hl[a]
        goods[b] = 0

print(sum(goods))
from collections import defaultdict

N ,M = map(int,input().split())
H = list(map(int,input().split()))
graph = defaultdict(set)
for _ in range(M-1):
    A, B = map(int,input().split())
    graph[A].add(B)
    graph[B].add(A)

cnt = 0
for i in range(1,N+1):
    t = H[i-1]
    flg = 0
    if all([H[j-1] < t for j in graph[i]]):
        cnt += 1
print(cnt)
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
    else:
        counter[A-1] = 0
        counter[B-1] = 0
print(sum(counter))
N, M = (int(x) for x in input().split())
H = [int(x) for x in input().split()]

high = set()
low = set()
lonely = set()

for i in range(M):
	i1, i2 = [int(x) for x in input().split()]
	if H[i1 - 1] != H[i2 - 1]:
		high.add(i2)
		low.add(i1)
	lonely.add(i1)
	lonely.add(i2)

result = len((high - low)) + (N  - len(lonely))
print(result)
[n,m] = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]
#table = [[0]*n for i in range(n)]
ls = [1] * n
for i in range(m):
    [a,b] = [int(j)-1 for j in input().split()]
    if h[a] < h[b]:
        ls[a] = 0
    else:
        ls[b] = 0
print(sum(ls))
#print(ls)
import collections
from collections import defaultdict

n,m=map(int,input().split())
h=[int(i) for i in input().split()]
graph=defaultdict(list)
for i in range(m):
    a,b=map(int,input().split())
    graph[a].append(b)
    graph[b].append(a)
count=0
print(graph)
for i in graph:
  for j in graph[i]:
      if h[j-1]>=h[i-1]:
          break
  else:
      count+=1
print(count)
n,m = map(int,input().split())
h = list(map(int,input().split()))

dic = {}
for i in range(1,n+1):
    dic[i] = 1
for j in range(1,m+1):
    h_1,h_2 = map(int,input().split())
    if h[h_1-1] < h[h_2-1]:
        dic[h_1] = 0
    else:
        dic[h_2] = 0
lis = list(dic.values())

print(lis.count(1))
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, M = map(int, readline().split())
H = [0] + list(map(int, readline().split()))
A = [0]*(N+1)

m = map(int, read().split())
for a,b in zip(m,m):
	for _ in range(2):
		A[a] = max(A[a], H[b])
		a,b = b,a

print(sum(x>y for x,y in zip(A, H)))
N, K = map(int, input().split())

H = input().split()
H2 = [0] * N
for i in range(K):
    a, b = map(int, input().split())
    if H[a-1] > H[b-1]:
        H2[b-1] = 1
    elif H[a-1] < H[b-1]:
        H2[a-1] = 1
    elif H[a-1] == H[b-1]:
        H2[b-1] = 1
        H2[a-1] = 1

count = 0
for i in H2:
    if i == 1:
        count+=1
print(count)
n, m = map(int, input().split())
h = list(map(int, input().split()))

flag = [True] * n
for _ in range(m):
    a, b = map(int, input().split())
    if h[a-1] >= h[b-1]:
        flag[b-1] = False
    elif h[b-1] > h[a-1]:
        flag[a-1] = False


cnt = 0
for i in flag:
    if i:
        cnt += 1
print(cnt)
N, M = [int(n) for n in input().split()]
H = [int(n) for n in input().split()]
visited = [0] * N
for i in range(M):
    a, b = [int(n)-1 for n in input().split()]
    if visited[a]<0 and visited[b]<0:
        continue
    if H[a] > H[b]:
        visited[b] = -1
        visited[a] = 1
    elif H[a] < H[b]:
        visited[a] = -1
        visited[b] = 1
    else:
        visited[a] = -1
        visited[b] = -1
print(visited.count(0)+visited.count(1))
N, M = (int(x) for x in input().split())
H = [int(x) for x in input().split()]

high = set()
low = set()
lonely = set()

for i in range(M):
    i1, i2 = [int(x) for x in input().split()]
    if H[i1 - 1] != H[i2 - 1]:
        high.add(i2)
    low.add(i1)
    lonely.add(i1)
    lonely.add(i2)

result = len((high - low)) + (N  - len(lonely))
N,M = map(int, input().split(' '))
heightList = input().split(' ')
checkifBestLT = [1 for i in range(N)]
nodeList =[[] for i in range(N)]

for i in range(M):
    node = input().split(' ')
    nodeList[int(node[0])-1].append(int(node[1])-1)
    nodeList[int(node[1])-1].append(int(node[0])-1)

for i in range(N):
    for j in nodeList[i]:
        if heightList[i] <= heightList[j]:
            checkifBestLT[i] = 0
            continue

print(sum(checkifBestLT))
count, way = list(map(int, input().split()))
height = list(map(int, input().split()))
isGood = [True] * count

for i in range(way):
    obs_a, obs_b = list(map(lambda x: int(x) - 1, input().split()))
    if(height[obs_a] > height[obs_b]):
        isGood[obs_b] = False
    else:
        isGood[obs_a] = False

print(isGood)
import sys
import math

n, m = map(int, input().split())
h = list(map(int, input().split()))
bli = [0] * n
for i in range(n):
    bli[i] = h[i]
for i in range(m):
    a, b = map(int, input().split())
    bli[a - 1] = max(bli[a - 1], bli[b - 1])
    bli[b - 1] = max(bli[b - 1], bli[a - 1])
cnt = 0
for i in range(n):
    if h[i] == bli[i]:
        cnt += 1
print(cnt)
N,M = map(int,input().split())
H = list(map(int,input().split()))

data = set([int(i) for i in range(1,N+1)])
tmp = set()
for _ in range(M):
    A,B = map(int,input().split())
    tmp.add(B)
# print(data)
# print(tmp)
print(len(data-tmp))
n,m = map(int, input().split())
h = [0]
h.extend([int(i) for i in input().split()])
bld = [0]*(n+1)

for i in range(m):
  a,b = map(int, input().split())
  if h[a]>h[b]:
    bld[b] += 1
  elif h[a]<h[b]:
    bld[a] += 1
    
print(bld.count(0)-1)
# -*- coding: utf-8 -*-

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

ans=[True for _ in range(n)]

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

print(ans.count(True))
n,m = map(int,input().split())
h = list(map(int,input().split()))
root = set()
for _ in range(m):
    s,g = map(int,input().split())
    path = tuple(sorted([s,g]))
    root.add(path)
print(n-len(root)+1)
N, M = map(int,input().split())
height = list(map(int,input().split()))
bet,cost = [],[0]*N
for i in range(M):
     bet.append(list(map(int,input().split())))

for b in bet:
    if height[b[0]-1] < height[b[1]-1]:
        cost[b[1]-1] = 1
    else:
        cost[b[0]-1] = 1

print(cost)
from collections import Counter
x=[]
y=[]
n,m=list(map(int,input().split()))
h=list(map(int,input().split()))


for i in range(m):
    a,b=list(map(int,input().split()))
    x.append(a)
    x.append(b)
    if h[a-1]>h[b-1]:
        y.append(a)
    elif h[a-1]<h[b-1]:
        y.append(b)


xx=Counter(x)
yy=Counter(y)

num=n-len(set(xx))
num2=len(set(yy))
print(num+num2) #孤立を考える
n,m = map(int,input().split())
h = list(map(int,input().split()))
ab = [map(int,input().split()) for _ in range(m)]
a, b = [list(i) for i in zip(*ab)]
ans = [True for _ in range(n)]
for i in range(m):
    if h[a[i]-1] > h[b[i]-1]:
        ans[b[i]-1] = False
    else:
        ans[a[i]-1] = False
answer = sum(ans)
print(answer)