peterverebics/CodeNet_Python_118 huggingface dataset:
n, m = list(map(int, input().split()))
hm = {i + 1: hi for i, hi in enumerate(list(map(int, input().split())))}
bad_h = []
for i in range(m):
    ai, bi = list(map(int, input().split()))
    if hm[ai] < hm[bi]:
        k = ai
    else:
        k = bi
    bad_h.append(k)
print(len(hm) - len(set(bad_h)))
n, m = map(int,input().split())
h = list(map(int,input().split()))
ab = [(list(map(int,input().split()))) for _ in range(m)]

ans = 0
path = [0] * n
check = [0] * n
for i in ab:
    path[i[0]-1] += 1
    path[i[1]-1] += 1
    if h[i[0]-1] < h[i[1]-1]:
        check[i[1]-1] += 1
    else:
        check[i[0]-1] += 1

for i in range(n):
    if path[i] == check[i]:
        ans += 1

print(ans)
N, M = map(int, input().split())
H = [int(h) for h in input().split()]
ans = [1] * N

# print(H)
for i in range(M):
    a, b = map(int, input().split())
    AH = H[a - 1]
    BH = H[b - 1]
    if AH >= BH:
        ans[b - 1] = 0
    elif BH >= AH:
        ans[a - 1] = 0


print(ans.count(1))
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(H)
print(A)
print(ans)
n,m = map(int,input().split())
h = list(map(int,input().split()))
ab = [list(map(int,input().split())) for i in range(m)]
gp = []
for i in range(len(ab)):
    a,b = ab[i][0],ab[i][1]
    good = max(h[a-1],h[b-1])
    gp.append(good)

print(len(list(set(gp))))
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(int, input().split()))
    if(height[obs_a - 1] > height[obs_b - 1]):
        isGood[obs_b - 1] = False
        height[obs_b - 1] = height[obs_a - 1]
    elif(height[obs_a - 1] < height[obs_b - 1]):
        isGood[obs_a - 1] = False
        height[obs_a - 1] = height[obs_b - 1]

print(len([ i for i in isGood if i ]))
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
    if 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)
N, M = map(int, input().split())
H = input()

s = set()

[s.add(max(map(int, input().split()))) for x in range(M)]

print(len(s))
def i():
    return int(input())
def i2():
    return map(int,input().split())
def s():
    return str(input())
def l():
    return list(input())
def intl():
    return list(int(k) for k in input().split())

n,m=i2()
h=intl()
cnt=0
score=0
l=[[] for i in range(n)]
for j in range(m):
	a,b=i2()
	l[a-1].append(b-1)
	l[b-1].append(a-1)
for j in range(n):
	for k in l[j]:
		if h[j]>k:
			cnt+=1
			if cnt==len(l[j]):
				score+=1
	cnt=0
print(score)
from operator import itemgetter
n,m = map(int,input().split())
h = list(map(int,input().split()))
cnt = 0
st = [list(map(int,input().split())) for i in range(m)]
graph = [False]*n
tansakuzumi = []
for i,j in st:
    if h[i-1] > h[j-1]:
        graph[i-1] = True
    elif h[i-1] < h[j-1]:
        graph[j-1] = True
    else:
        graph[i-1] = True
for i in graph:
    if i:
        cnt += 1
print(cnt)
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,b = a-1,b-1

    if h[a] < h[b]:
        ans[a] = 0
    elif h[b] < h[a]:
        ans[b] = 0
    else:
        ans[a] = 0
        ans[b] = 0

print(ans)
from collections import defaultdict
n , m = map(int , input().split())
h  = list(map(int , input().split()))
dic = defaultdict(list)
for i in range(m):
	u , v = map(int , input().split())
	dic[u].append(v)
	dic[v].append(u)
ans = 0
for i in range(1, n+1):
	currh = h[i-1]
	f = 1
	if i in dic: 
		for obs in dic[i]:
			if i == obs: continue
			if h[obs-1] > currh:
				f = 0
				break
		if f:
			ans+=1
	else:
		ans+=1
print(ans)
N, M = map(int, input().split())
H = list(map(int, input().split()))

h = []
for i in H:
    h.append(i)
for i in range(M):
    a, b = map(int, input().split())
    if h[a-1] <= H[b-1] and h[b-1] != -1:
        h[a-1] = -1
    if h[b-1] <= H[a-1] and h[b-1] != -1:
        h[b-1] = -1

ans = N
for i in h:
    if i == -1:
        ans -= 1

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

for i in range(n):
    if arr[i]>=0:
        ans+=1
print(ans)
import sys
import math
import itertools
n,m=map(int,input().split())
h = list(map(int, input().split()))
ans=[True]*n
lis = [] * n
for i in range(len(h)):
    lis.append(h[i])
print(lis)
for i in range(m):
    a, b = map(int, input().split())
    lis[a - 1] = max(lis[a - 1], lis[b-1])
    lis[b - 1] = max(lis[b - 1], lis[a - 1])
    lis[a - 1] = max(lis[a - 1], lis[b-1])
ans = 0
print(lis)
for i in range(n):
    if (lis[i] != h[i]):
        ans += 1
print(ans)
# coding: utf-8

############################

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

for _ in range(m):
    ab = list(map(int,input().split()))
    h.discard(min(ab))
    
print(len(h))
N, M = map(int, input().split())
h = list(map(int, input().split()))
li = []
for m in range(M):
  a, b = map(int, input().split())
  if h[a-1] < h[b-1]:
    li.append(a)
  if h[a-1] == h[b-1]:
    li.append(a)
    li.append(b)
  else:
    li.append(a)

answer = N - len(set(li))
print(answer)
import copy
N,M = map(int,input().split(' '))
H = list(map(int,input().split(' ')))
H_pop = copy.copy(H)
load_list = []
for i in range(M):
    load = list(map(int,input().split(' ')))
    load_list.append(load)
for i in load_list:
    A = H[int(i[0]-1)]
    B = H[int(i[1]-1)]
    try:
        if A < B:
            H_pop.remove(A)
        else:
            H_pop.remove(B)
    except ValueError:
        pass
print(len(H_pop))
n,m = map(int,input().split())
h = list(map(int,input().split()))
g = [[] for i in range(n)]
for i in range(m):
    a,b = map(int,input().split())
    a -= 1
    b -= 1
    g[a].append(h[b])
    g[b].append(h[a])
ans = 0
for i in range(n):
    if len(g[i]) == 0:
        ans +=1
        continue
      
    if h[i] >= max(g[i]):ans += 1
print(ans)
NM = list(map(int, input().split()))
N=NM[0]
M=NM[1]
H = list(map(int, input().split()))
AB_list = []
for i in range(M):
  AB = list(map(int, input().split()))
  AB_list.append(AB)
  
good = []
queue = list(range(1,N+1))
while queue:
  n = queue.pop()
  hi = H[n-1]
  i = n+1
  reachable = list(set(sum([x for x in AB_list if i in x],[])))
  if not reachable:
    good.append(i)
    continue
  reachable.remove(i)
  reachable_hi = [H[x-1] for x in reachable]
  if max(reachable_hi) < hi:
    good.append(i)
    queue = list(set(queue)-set(reachable))
print(len(good))
n,m=[int(_) for _ in input().split()]
dic={}
height=[int(b) for b in input().split()][:n]
list1=[]
count=0
for j in range(n):
    dic[j+1]=height[j]
for i in range(m):
    a,b=[int(q) for q in input().split()]
    if dic[a]>dic[b]:
        
        list1.append(b)
    elif dic[b]>dic[a]:
        list1.append(a)
    else:
        list1.append(a)
        list1.append(b)
            
print(len(set(list1)))
N, M = map(int,input().split())
H = list(map(int,input().split()))
ans = [0]*N
for _ in range(M):
    A, B = map(int,input().split())
    if H[A-1] >= H[B-1]:
        ans[A-1] = 1
    if H[A-1] <= H[B-1]:
        ans[B-1] = 1
print(ans.count(1))
import numpy as np

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

ans = np.array([1 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] = 1
		ans[A-1] = 0
	elif H[A-1] > H[B-1]:
		ans[A-1] = 1
		ans[B-1] = 0
	else:
		ans[A-1], ans[B-1] = 0, 0

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

for i in range(M):
  A,B=map(int,input().split())
  X[B-1][A-1]+=1
  X[A-1][B-1]+=1


for p in range(N):
  for q in range(N):
    if X[p][q]==1:
      if H[p]>H[q]:
        count.append(p)
        
print(len(list(set(count))))
N, M = [int(x) for x in input().strip().split(" ")]
H = [int(x) for x in input().strip().split(" ")]

no_good = []
for _ in range(M):
    a, b = [int(x) for x in input().strip().split(" ")]
    a -= 1
    b -= 1
    if H[a] >= H[b]:
        no_good.append(b)
    elif H[a] <= H[b]:
        no_good.append(a)
print(N - len(set(no_good)))
n, m = map(int, input().split())

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

workList = [1] * n

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

print(sum(workList))
n, m = map(int, input().split())
h = [int(i) for i in input().split()]
list = [[i, []] for i in range(n)]

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

ans_list = []
for i in range(n):
  tmp = 0
  if list[i][1] == []:
    tmp = 1
  else:
    for j in range(len(list[i][1])):
      if h[list[i][0]] > h[list[i][1][j]]:
        tmp = 1
  ans_list.append(tmp)

print(str(sum(ans_list)))
N, M = map(int, input().split())

high_list = list(map(int, input().split()))
check_list = [1]*N

for i in range(M):
  a_, b_ = map(int, input().split())
  if high_list[a_-1] < high_list[b_-1]:
    check_list[a_-1] = 0
  elif high_list[a_-1] > high_list[b_-1]:
    check_list[b_-1] = 0
  elif high_list[a_-1] == high_list[b_-1]:
    check_list[a_-1] = 0
    check_list[b_-1] = 0

print(len(check_list))
h, m =map(int,input().strip().split())

height=list(map(int,input().strip().split()) )
lst=[1]*h

for i in range(m):
    a,b=map(int,input().strip().split())
    if height[a-1]>height[b-1]:
        lst[b-1]=0
    elif height[a-1]<height[b-1]:
        lst[a-1]=0
    else:
        lst[b - 1] = 0
        lst[a - 1] = 0
print(lst)
print(lst.count(1))
n,m=map(int,input().split())
h=list(map(int,input().split()))
ll=[]
for i in range(m):
    a,b=map(int,input().split())
    if h[a-1]<h[b-1]:
        lose=[a]
    elif h[a-1]>h[b-1]:
        lose=[b]
    else:
        lose=[a,b]
    ll += lose
print(ll)
import collections
c=collections.Counter(ll)
print(n-len(c))
N, r = map(int, input().split())
hs = list(map(int, input().split()))
g = [1]*N
for i in range(r):
    road = list(map(int, input().split()))
    if hs[road[0] - 1] > hs[road[1] - 1]:
        g[road[1] - 1] = 0
    else:
        g[road[0] - 1] = 0
print(sum(g))
(n, m), h, *r = [[*map(int, i.split())] for i in open(0)]
g =[] + h

for i in r:
    g[i[0]-1] *= h[i[0]-1] > h[i[1]-1]
    g[i[1]-1] *= h[i[1]-1] > h[i[0]-1]
print(len(set(g) - {0}))
N,M = map(int,input().split())
H = map(int,input().split())
datas = []
for i in range(M):
    datas.append(max(list(map(int,input().split()))))
print(len(set(datas)))
import collections
n,m = list(map(int,input().split()))
tower_high = list(map(int,input().split()))
good_tower = [1]*n

def check_tower(a,b):
    if tower_high[a]<tower_high[b]:
        good_tower[a]=0
    elif tower_high[a] > tower_high[b]:
        good_tower[b]=0
    else:
        good_tower[a]=0
        good_tower[b]=0

for i in range(m):
    a,b=list(map(int,input().split()))
    check_tower(a-1,b-1)
print(good_tower)
print(good_tower.count(1))
N,M=map(int,input().split())
H=list(map(int,input().split()))
A,B=[0]*M,[0]*M
for i in range(M):
  A[i],B[i]=map(int,input().split())
lst=[1]*N
for i in range(M):
  if H[A[i]-1]<H[B[i]-1]:
    lst[A[i]-1]=0
  if H[A[i]-1]>H[B[i]-1]:
    lst[B[i]-1]=0
print(sum(lst))
def input_map():
  return list(map(int, input().split(' ')))

data_list = input_map()
h_list = input_map()

load_list = []
for x in range(data_list[1]):
  tmp = input_map()
  load_list.append(tmp)
  load_list.append(list(reversed(tmp)))

good_list = []
nouse_list = list(range(1, data_list[0]))
for load in load_list:
  if load[0] in nouse_list:
    nouse_list.remove(load[0])
  if h_list[load[0]-1] > h_list[load[1]-1] and load[0] not in good_list:
    good_list.append(load[0])

print(len(good_list) + len(nouse_list))
n,m=map(int,input().split())
heights=list(map(int,input().split()))
heights_w=sorted([(h,i+1) for i,h in enumerate(heights)])
cons={i+1:set() for i in range(n)}
for _ in range(m):
  a,b=map(int,input().split())
  cons[a].add(b)
  cons[b].add(a)

watched=set()
res=0
for h,i in heights_w:
  if i in watched:
    continue
  watched.add(i)
  flg=True
  for con in cons[i]:
    flg=(flg and h<=heights[con-1])
    watched.add(con)
  if flg:
    res+=1
print(res)
import numpy as np

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

ok=np.zeros(N)
for i in range(M):
    if A[i][0]>A[i][1]:
        ok[A[i][0]-1]=1
    else:
        ok[A[i][1]-1]=1
print(int(np.sum(ok)))
N, M = map(int,input().split())
H = list(map(int, input().split()))
arr = [list(map(int, input().split())) for i in range(M)]
highest_tenbo = [0 for i in range(N)]

for a, b in arr:
    highest_tenbo[a-1] = max(highest_tenbo[a-1], H[b-1])
    highest_tenbo[b-1] = max(highest_tenbo[b-1], H[a-1])

ans = 0
for i, t in enumerate(highest_tenbo):
  if not t < H[i]:
    ans+=1
print(ans)
N,M=map(int,input().split())
H=list(map(int,input().split()))

ans_list=list(range(1,N+1))

for i in range(M):
    a,b=map(int,input().split())
    m=min(a,b)
    if m in ans_list:
        ans_list.remove(m)
print(len(ans_list))
N,M=map(int,input().split())
H=list(map(int,input().split()))
l=[]

for i in range(M):
    l.append(list(map(int,input().split())))
    
ll=[0]*N

for j in l:
    if H[j[0]-1]-H[j[1]-1]>0:
        ll[j[1]-1]+=1
    elif H[j[0]-1]-H[j[1]-1]<0:    
        ll[j[0]-1]+=1
    else:
        continue
        
ans=0
for x in ll:
    if x==0:
        ans+=1

print(ans)
n, m = list(map(int, input().split()))
h_list = list(map(int, input().split()))
hh_list = [1] * n

for mm in range(m):
    a, b = list(map(int, input().split()))
    if h_list[a-1] - h_list[b-1] < 0:
        hh_list[a-1] = 0

counter = 0
for hh in hh_list:
    if hh >= 1:
        counter += 1
print(counter)
N, M = map(int, input().split())
H = list(map(int, input().split()))
ans = [] #展望台No
for i in range(M):
    ai, bi = map(int, input().split())
    if H[ai-1] < H[bi-1]:
        ans.append(bi)
    else:
        ans.append(ai)

d = {}
for num in ans:
    if num not in d:
        d[num] = 1
    else:
        d[num]+=1

print(len(d))
#!/usr/bin/env python3

N, M = map(int, input().split())
H = list(map(int, input().split()))
#AB = [list(map(int, input().split())) for _ in range(M)]
X = [[] for _ in range(N)]
for _ in range(M):
    A, B = map(int, input().split())
    X[A-1].append(B)
    X[B-1].append(A)

cnt = 0
ans = set()

for i in range(N):
    if len(X[i]) == 0:
        ans.add(i)
    else:
        for j in X[i]:
            if H[i] > H[j-1]:
                ans.add(i)

print(len(ans))
def solve():
  n, m = map(int, input().split())
  h = list(map(int, input().split()))
  tenbo = []
  bit = [0]*n
  for i in range(m):
    tenbo.append(list(map(int, input().split())))
  hoge = [[] for i in range(n)]
  for i in range(m):
    hoge[tenbo[i][0]-1].append(tenbo[i][1]-1)
    hoge[tenbo[i][1]-1].append(tenbo[i][0]-1)
  for i in range(n):
    for j in hoge[i]:
      if h[i] <= h[j]:
        bit[i] = 1
        break
  print(bit.count(1))
  return 0

 
if __name__ == "__main__":
  solve()
N, M = map(int,input().split())
H = list(map(int,input().split()))
count = 0
for _ in range(M):
    A, B = map(int,input().split())
    if H[B-1] < H[A-1]:
        count +=1
    if H[B-1] > H[A-1]:
        count +=1
print(count)
N, M = map(int, input().split())
Hlist = list(map(int, input().split()))
ABList = []

ansdic = {}

for i in range(M):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    if Hlist[a] < Hlist[b]:
        ansdic[Hlist[b]] = True
        ansdic[Hlist[a]] = False

ans = 0

for h in Hlist:
    if h in ansdic:
        if ansdic[h]:
            ans += 1
    else:
        ans += 1

print(ans)
n,m = map(int,input().split())
h = input().split(" ")
hlist = [int(n) for n in h]
alist = []
for i in range(m):
  a,b = map(int,input().split())
  if hlist[a-1]>hlist[b-1]:
      alist.append(hlist[b-1])
  if hlist[b-1]>hlist[a-1]:
      alist.append(hlist[a-1])
set_ab = set(hlist) - set(alist)
blist = list(set_ab)
kotae = len(blist)
print(kotae)
N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
AB = [list(map(int, input().split())) for i in range(M)]
# print(N, M, H, AB)


dictionary = {}
for A, B in AB:
    if dictionary.get(A) is None:
        dictionary[A] = []
    if dictionary.get(B) is None:
        dictionary[B] = []

    dictionary[A].append(H[B - 1])
    dictionary[B].append(H[A - 1])
# print(dictionary)

count = 0
for key, heights in dictionary.items():
    # print(key, heights)
    if H[key - 1] >= max(heights):
        count += 1

print(count)
import sys
sys.setrecursionlimit(10 ** 6)

def main():
    N, M = map(int, input().split())
    H = list(map(int, input().split()))
    T = [0] * N
    for _ in range(M):
        A, B = map(int, input().split())
        x = max(H[A-1], H[B-1])
        T[A-1] = max(T[A-1], x)
        T[B-1] = max(T[B-1], x)
    print(len([1 for x in zip(T, H) if x[0] == x[1]]))

if __name__ == '__main__':
    main()
import numpy as np

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

#base = np.zeros(n)
#seen = np.zeros((n,n))

#for i in range(m):
#  a,b = map(int,input().split())
#  seen[a-1,b-1] = 1
#  seen[b-1,a-1] = 1
  
ans = 0
#for i in range(n):
#  temp = np.multiply(seen[i],h)
#  temp_1 = np.max(temp)
#  if (h[i] > temp_1) and (temp_1 != 0):
#    ans += 1
#  elif temp_1 == 0:
#    ans += 1
    
print(ans)
N,M = map(int,input().split())
H = list(map(int,input().split()))
datas = []
ans = []
for i in range(M):
    datas.append(list(map(int,input().split())))
for data in datas:
    a,b = data
    if H[a-1] > H[b-1]:
        ans.append(a)
    else:
        ans.append(b) 
print(len(set(ans)))
#C
n, m = list(map(int, input().split()))
h = list(map(int, input().split()))


result = [1 for _ in range(n)]
for _ in range(m):
    a, b = list(map(int, input().split()))
    if h[a-1] < h[b-1]:
        result[b-1] = 1
        result[a-1] = 0
    elif h[a-1] < h[b-1]:
        result[b-1] = 0
        result[a-1] = 1
    else:
        result[b-1] = 0
        result[a-1] = 0
    
print(result.count(1))
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][1]-1]=0
print(sum(sup_list))
N, M = map(int, input().split())
H = [int(i) for i in input().split()]
G = [0]*N

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

print(G.count(0))
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 == 0:
        count+=1
print(count)
N,M = map(int,input().split())
H = list(map(int,input().split()))
datas = []
ans = []
count = 1
dic = []
for h in H:
    dic.append({count:h})
    count += 1
for i in range(M):
    datas.append(list(map(int,input().split())))
for data in datas:
    a,b = data
    if H[a-1] > H[b-1]:
        ans.append(a)
    else:
        ans.append(b) 
print(len(set(ans)))
n,m=map(int,input().split())

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

#良ければ１、
result=[1]*n

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

    if h[a]<h[b]:
        result[a]=0
    else:
        result[b]=0

cnt=0
for item in result:
    if item==1:
        cnt+=1
print(cnt)
import numpy as np
N, M = list(map(int, input().split()))
H = list(map(int, input().split()))
G = N
lists = np.zeros(N)
for i in range(M):
    A, B = list(map(int, input().split()))
    if H[A-1] < H[B-1]:
        lists[A-1] = 1
    else:
        lists[B-1] = 1
for i in range(N):
    if lists[i-1] == 1:
        G -= 1
print(G)
N,M = (int(x) for x in input().split())
H   = [int(x) for x in input().split()]
Way = [[] for I in range(N)]
for T in range(0,M):
    A,B = (int(x) for x in input().split())
    Way[A-1].append(B)
    Way[B-1].append(A)
    
Count = 0
for TT in range(0,N): 
    if [H[TT]]>[H[I-1] for I in Way[TT]]:
        Count = Count+1
print(Count)
N,M = map(int,input().split(" "))
H = input().split(" ")
for i in range(N):
  H[i]=[int(H[i]),1]
for j in range(M):
  A,B = map(int,input().split(" "))
  if H[A-1][0]>=H[B-1][0]:
    H[B-1][1]=0
  else:
    H[A-1][1]=0
compte=0
for k in range(N):
  if H[k][1]==1:
    compte+=1
print(compte)
N,M = map(int,input().split())
H = input().split()
A = [0]*M
B = [0]*M
result = [1] * N
for i in range(M):
    A,B=map(int,input().split())
    A-=1
    B-=1
    if  H[A]>H[B]:
        if result[A]!=2:
            result[B]=2
    elif  H[A]<H[B]:
        if result[B]!=2:
            result[A]=2
    else:
        result[A]=2
        result[B]=2
print(result.count(1))
N, M = map(int, input().split())
H = list(map(int, input().split()))
conditions = [[] for _ in range(N)]
for i in range(M):
    a, b = map(int, input().split())
    conditions[a - 1].append(b - 1)
    conditions[b - 1].append(a - 1)

bad_count = [1] * N
# print(conditions)
for i, cond in enumerate(conditions):
    for j in cond:
        if H[i] <= H[j]:  # bimyou
            bad_count[i] = 0
            # print(f'{i} is bad')

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

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

print(t.count(n+1))
n, m = map(int, input().split())
h = list(map(int, input().split()))
r = [[0] * n for _ in range(n)]

p = [1] * n

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

# print(p)
# print(r)
print(p.count(1))
N, M= (int(x) for x in input().split())
height=[int(x) for x in input().split()]
#height=[8,6,9,1,2,1]
nlist=[i for i in range(1,N+1)]
#print(nlist)

for i in range(M):
    a, b =(int(x) for x in input().split())
    c=height.index(min(height[a-1], height[b-1]))+1
    print(c)
    if c in nlist:
        nlist.remove(c)
print(len(nlist))
N,K = map(int, input().split())
H = list(map(int, input().strip().split()))
A = []
for i in range(0,K):
    array = list(map(int, input().strip().split()))
    A.append(array)
des = []
for i in range(0,K):
    if(H[A[i][0]-1] > H[A[i][1]-1]):
       des.append(H[A[i][1]-1])
    else:
        des.append(H[A[i][0]-1])
ans = sorted(set(des), key=des.index)
print(N-len(ans))
import sys

lines = sys.stdin.readlines()

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

H = []
Y = []

for i in range(N):
    H.append(int(lines[1].split(' ')[i]))

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)
n,m=map(int,input().split())
h=list(map(int,input().split()))
anslist=[1]*n
for i in range(m):
  a,b=map(int,input().split())
  ah=h[a-1]
  bh=h[b-1]
  if ah>bh:
    anslist[b-1]=0
  else:
    anslist[a-1]=0
print(anslist.count(1))