peterverebics/CodeNet_Python_118 huggingface dataset:
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))
n, m = map(int, input().split())
h = list(map(int,input().split()))
x = [0 for i in range(n)]

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

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

print(ans)
n,m = map(int,input().split())
h = list(map(int,input().split()))
ans = []
for i in range(m):
    a,b = map(int,input().split())
    if h[a-1] < h[b-1]:
        if not a-1 in ans:
            ans.append(a-1)
    elif h[a-1] > h[b-1]:
        if not b-1 in ans:
            ans.append(b-1)
    else:
        if not a-1 in ans:
            ans.append(a-1)
        if not b-1 in ans:
            ans.append(b-1)
print(n-len(ans))
x,try_k = map(int,input().split())

input_x = input().split()

list_a = [0]*x
list_b = [[] for i in range(x)]
for i in range(len(list_a)):
  list_a[i] = int(input_x[i])

for i in range(try_k):
  a,b = map(int,input().split())
  
  list_b[b-1].append(list_a[a-1])
  list_b[a-1].append(list_a[b-1])
  
#print(list_b)
count = 0
for i in range(x):
  if(len(list_b[i]) == 0):
     count += 1
     continue
  if(list_a[i] > max(list_b[i]) ):
    count += 1
print(count)
import sys
import math
import itertools

n, m = map(int, input().split())
h = list(map(int, input().split()))
ans = [True] * n
lis = [0] * n
for i in range(m):
    a, b = map(int, input().split())
    lis[a - 1] = max(lis[a - 1], h[b - 1])
    lis[b - 1] = max(lis[b - 1], h[a - 1])
ans = 0
for i in range(n):
    if lis[i] < h [i]:
        ans += 1
print(ans)
n, m = map(int, input().split())
h_lis = list(map(int, input().split()))
ab_lis = [list(map(int, input().split())) for _ in range(m)]
ans=[True]*n

for ab_li in ab_lis:
    #print(ab_li)
    if h_lis[ab_li[0]-1] > h_lis[ab_li[1]-1]:
        ans[ab_li[1]-1] = False
    elif h_lis[ab_li[0]-1] < h_lis[ab_li[1]-1]:
        ans[ab_li[0]-1] = False
    else:
        ans[ab_li[0]-1], ans[ab_li[1]-1] = False, False
#print(ans)
print(sum(ans))
N,M = map(int,input().split())
H = list(map(int,input().split()))

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

ans = 0

for i in range(N):
    det = 1
    for x in data[i]:
        if H[i] <= H[x]:
            det = 0
            break
    ans += det

print(ans)
N, M = map(int, input().split())
height = list(map(int, input().split()))
bridge = [1]*N

for i in range(M):
    X, Y = map(int, input().split())
    if height[X-1] >= height[Y-1]:
        bridge[Y-1] =0
    if height[Y-1] >= height[X-1]:
        bridge[X-1] =0

print(bridge.count(1))
def resolve():
    N, M = map(int, input().split())
    H = list(map(int, input().split()))
    not_good = []
    for i in range(M):
        A, B = map(lambda x: int(x) - 1, input().split())
        if H[A] > H[B]:
            not_good.append(B)
        elif H[A] < H[B]:
            not_good.append(A)
        elif H[A] == H[B]:
            not_good.extend([A, B])
    print(N - len(set(not_good)))

resolve()
n, m = list(map(int, input().split()))
hs =  list(map(int, input().split()))
ans = [1]*n
roads = []
for i in range(m):
    roads += [list(map(int, input().split()))]
for road in roads:
    if hs[road[0]-1] <= hs[road[1]-1]:
        ans[road[0]-1] = 0
    if hs[road[0]-1] >= hs[road[1]-1]:
        ans[road[1]-1] = 0
print(ans.count(1))
n, m = map(int, input().split())
good = [True for _ in range(n)]
h = list(map(int, input().split()))
for i in range(m):
  a, b = map(int, input().split())
  if(h[a-1] >= h[b-1]):
    good[b-1] = False
  if(h[a-1] <= h[b-1]):
    good[a-1] = False
print(good.count(True))
n, m = map(int, input().split())
h = list(map(int, input().split()))

hantei = [1]*n

for i in range(m):
    data = list(map(int, input().split()))

    if h[data[0]-1] < h[data[1]-1]:
        hantei[data[0]-1] = 0
    elif h[data[0]-1] > h[data[1]-1]:
        hantei[data[1]-1] = 0
    else:
        hantei[data[0]-1] = 0
        hantei[data[1]-1] = 0

print(sum(hantei))
import sys
input = sys.stdin.readline

# C - Peaks
def get_index(s):
	return int(s) - 1
	

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

for i in range(m):
	a, b = map(get_index, input().split())
	
	rivals[a] = max(rivals[a], h[b])
	rivals[b] = max(rivals[b], h[a])

ans = 0

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

print(ans)
N, M = map(int, input().split())
H = list(map(int, input().split()))

adj = [list() for _ in range(N)] # 頂点の個数
for _ in range(M):
    A, B = map(int, input().split())
    A -= 1
    B -= 1
    adj[A].append(B)
    adj[B].append(A)


def is_higher(i):
    for j in adj[i]:
        if H[i] <= H[j]:
            return False
    return True

cnt = 0
for i in range(N):
    if is_higher(i):
        cnt += 1
print(cnt)
n,m = map(int,input().split())
high = list(map(int,input().split()))
num = []
for i in range(m):
  mountain = list(map(int,input().split()))
  if high[mountain[0] - 1] < high[mountain[1] - 1]:
    num.append(mountain[0])
  elif high[mountain[0] - 1] == high[mountain[1] - 1]:
    num.append(mountain[0])
    num.append(mountain[1])
  else:
    num.append(mountain[1])
ans = [0]*n
for i in num:
  ans[i -1] = 1
cnt = 0
for i in ans:
  if i == 0:
    cnt += 1
print(cnt)
N, M = map(int, input().split())
H = list(map(int, input().split()))
links = [list(map(int, input().split())) for _ in range(M)]
survivors = [True for _ in range(N)]

for a, b in links:
  if H[a-1] <= H[b-1]:
    survivors[a-1] = False
  if H[b-1] <= H[a-1]:
    survivors[b-1] = False

print(sum(survivors))
N, M = map(int, input().split())
h_list = list(map(int, input().split()))

# 隣接する展望台より低い時点でbad
bad_set = set()
for _ in range(M):
    src, dst = map(int, input().split())
    src_h = h_list[src - 1]
    dst_h = h_list[dst - 1]
    if src_h < dst_h:
        bad_set.add(src)
    elif dst_h < src_h:
        bad_set.add(dst)
    else:
        bad_set.add(src)
        bad_set.add(dst)

print(N - len(bad_set))
R = lambda: map(int, input().split())
n, m = R()
h = [None, *R()]
g = [0] + [1] * n
for _ in range(m):
  a, b = R()
  if h[a] <= h[b]:
    g[a] = 0
  if h[b] <= h[a]:
    g[b] = 0
print(sum(g))
N,M=map(int,input().split())
H=list(map(int,input().split()))
good=[1 for _ in range(N)]

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

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

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

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

print(len([i for i in good if i]))
N, M = map(int, input().split())
H = list(map(int, input().split()))

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

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

count = 0
for g in good:
    if g == 1:
        count += 1

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

Evaluation = [0] * N

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

count = 0    
for i in range(N):
  if Evaluation[i] == 0:
    count += 1

print(count)
n,m=map(int,input().split())
h=list(map(int,input().split()))
good=[True]*n
for i in range(m):
    a,b=map(int,input().split())
    a-=1;b-=1
    if h[a]<h[b]:
        good[a]=False
    elif h[b]<h[a]:
        good[b]=False
    elif h[b]==h[a]:
        good[a]=False
        good[b]=False
print(good.count(True))
n,m = map(int, input().split())
h_list = list(map(int,input().split()))
ans = [1]*n
for i in range(m):
    a,b = map(int, input().split())
    if h_list[a-1] == h_list[b-1]:
        ans[a-1] = 0
        ans[b-1] = 0
    else:
        if h_list[a-1] > h_list[b-1]:
            ans[b-1] = 0
        else:
            ans[a-1] = 0
print(sum(ans))
N, M = list(map(int, input().split()))

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

notgoods = [False for _ in range(N)]

for m in range(M):
    a, b = list(map(int, input().split()))
    if H[a - 1] <= H[b - 1]:
        notgoods[a - 1] = True
    if H[b - 1] <= H[a - 1]:
        notgoods[b - 1] = True

print(N - sum(notgoods))
N,M = map(int,input().split())

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

ans =[1]*N

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

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

print(sum(ans))
N, M = map(int, input().split())			# "5 7" -> ["5", "7"] -> 5, 7 => N=5,K=7
H =        list( map(int, input().split()) )	# 1 2 3 4 5 ...

AB=[]
for m in range(M):
	a,b = map(int, input().split())			# "5 7" -> ["5", "7"] -> 5, 7 => N=5,K=7
	AB.append([a-1,b-1])

X=[0]*N
for a,b in AB:
	
	X[a] = max(X[a], H[b])
	X[b] = max(X[b], H[a])

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

print(ans)
import math , sys

N , M = list(map(int, input().split()))
H = list(map(int, input().split()))
Es = [[] for _ in range(N)]
for i in range(M):
    A , B = list(map(int, input().split()))
    A -=1 ; B-=1
    Es[A].append(B)
    Es[B].append(A)
ans = 0
for i in range(N):
    Es[i] = list(set(Es[i]))
for i in range(N):
    if len(Es[i]) == 0:
        ans+=1
    else:
        Max = max( [ H[Es[i][j]] for j in range( len(Es[i]) ) ] )
        if H[i] > Max:
            ans+=1
print(ans)
(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([i for i in g if i !=0]))
N, M = map(int, input().split())
H = list(map(int, input().split()))
OK = [True] * N
for _ in range(M):
    A, B = map(lambda x: int(x)-1, input().split())
    if H[A] < H[B]:
        OK[A] = False
    elif H[A] > H[B]:
        OK[B] = False
    else:
        OK[A] = False
        OK[B] = False

ans = sum(OK)
print(ans)
def main():
    N, M = [int(x) for x in input().split()]
    H = [0] + [int(x) for x in input().split()]
    flag = [0] + [1] * N
    for _ in range(M):
        a, b = [int(x) for x in input().split()]
        if H[a] >= H[b]:
            flag[b] = 0
        if H[b] >= H[a]:
            flag[a] = 0
    
    print(sum(flag))

if __name__ == "__main__":
    main()
N, M = map(int, input().split())
H = list(map(int, input().split()))


A_list = []
B_list = []
Remove_list = []

for _ in range(M):
  A, B = map(int, input().split())
  A_list.append(A - 1)
  B_list.append(B - 1)

for A, B in zip(A_list, B_list):
  A_height = H[A]
  B_height = H[B]
  
  if A_height <= B_height:
    Remove_list.append(A)
  
  if B_height <= A_height: 
    Remove_list.append(B)
  
S = set(range(N))
S = S - set(Remove_list)

print(len(S))
n,m = list(map(int,input().split()))
harr = list(map(int,input().split()))
ans = [True] * n
for i in range(m):
    a,b = list(map(int,input().split()))
    s = harr[a-1]; t = harr[b-1]
    if s > t:
        ans[b-1] = False
    elif s < t:
        ans[a-1] = False
    else:
        ans[a-1] = ans[b-1] = False

print(sum(ans))
import copy
n, m = map(int, input().split())
H = list(map(int, input().split()))
ANS = copy.deepcopy(H)

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] = 0
    ANS[b-1]= 0
  else:
    ANS[a-1] = 0
ans = 0
for i in range(n):
  if ANS[i] != 0:
    ans += 1
print(ans)
n,m=map(int,input().split())
H=list(map(int,input().split()))
L=[]
for i in range(m):
    a,b=map(int,input().split())
    if H[a-1]<H[b-1]:
        L.append(a)
    elif H[a-1]>H[b-1]:
        L.append(b)
    else:
        L.append(a)
        L.append(b)
print(n-len(set(L)))
n,m =map(int,input().split())

H=[]
H=list(map(int,input().split()))
C=[]
for i in range(n):
    C.append(1)

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

print( C.count(1))
n, m = map(int, input().split())
h = list(map(int, input().split()))
li = list(range(1,n+1))
ab = [list() for _ in range(m)]

p = []

ih = dict(zip(li, h))

for i in range(m):
    a, b = map(int,input().split())
    c = ih[a]
    d = ih[b]
    if c>d:
        p.append(b)
    elif d>c:
        p.append(a)
    else:
        p.append(a)
        p.append(b)

print(n-len(set(p)))
import sys
N, M = map(int, sys.stdin.readline().split())
H = list(map(int, sys.stdin.readline().split()))
AB = [list(map(int, sys.stdin.readline().split())) for i in range(M)]
ans = [1] * N
for i in range(M):
    a, b = AB[i]
    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()))
ab = [list(map(int, input().split())) for _ in range(m)]

x = [set() for _ in range(n)]
for a, b in ab:
    x[a-1].add(b-1)
    x[b-1].add(a-1)
    
ans = 0
for i, xx in enumerate(x):
    for xxx in xx:
        if h[i] <= h[xxx]:
            break
    else:
        ans += 1
        
print(ans)
N, M = map(int, input().split())
H = list(map(int, input().split()))
a = [True] * N
for i in range(M):
  ai, bi = map(int, input().split())
  if H[ai-1] <= H[bi-1] :
    a[ai-1] = False
  if H[ai-1] >= H[bi-1]:
    a[bi-1] = False
print(sum(a))
n, m = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]
lst = [True]*n
for _ in range(m):
    a, b = [int(i) for i in input().split()]
    if h[a-1] > h[b-1]:
        lst[b-1] = False
    elif h[a-1] < h[b-1]:
        lst[a-1] = False
    elif h[a-1] == h[b-1]:
        lst[a-1] = False
        lst[b-1] = False
ans = 0
for i in lst:
    if i:
        ans += 1
print(ans)
N,M = map(int,input().split())
H = list(map(int,input().split()))
ans = [0]*N


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

ans = [i for i in range(N) if ans[i]==0]
print(len(ans))
N, M = map(int, input().split())
H = list(map(int, input().split()))
Root = []
for i in range(M):
  temp = list(map(int, input().split()))
  Root.append(temp)

ans = [1]*N

for i in range(M):
  r_start = Root[i][0] - 1 
  r_stop = Root[i][1] - 1
  if H[r_start] < H[r_stop]:
    ans[r_start] = 0
  elif H[r_start] == H[r_stop]:
    ans[r_start] = 0
    ans[r_stop] = 0
  else:
    ans[r_stop] = 0

print(sum(ans))
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())
mountains = [0]*N
for i in range(M):
    if H[A[i]-1]>H[B[i]-1]:
        mountains[B[i]-1] -= 1
    elif H[A[i]-1]<H[B[i]-1]:
        mountains[A[i]-1] -= 1
    else:
        mountains[B[i]-1] -= 1
        mountains[A[i]-1] -= 1
print(mountains.count(0))
import sys
readline = sys.stdin.buffer.readline
arr = []
n,m= list(map(int,readline().rstrip().split()))
h = readline().rstrip().decode().split()
for i in range(m):
  k,l= list(map(int,readline().rstrip().split()))
  if int(h[k-1]) > int(h[l-1]):
    arr.append(l)
  elif int(h[k-1]) < int(h[l-1]):
    arr.append(k)
  else:
    arr.append(l)
    arr.append(k)
print(n-len(set(arr)))
NM = input().split() #N 個の展望台 M本の道
N = int(NM[0])
M = int(NM[1])

H = [] #展望台の高さ
H = input().split()

R =[True]*(N+1)
R[0]=False


for i in range(M):
  tmp = input().split()
  tmp_int = [0,0]
  tmp_int[0] = int(tmp[0])
  tmp_int[1] = int(tmp[1])
  if  int(H[tmp_int[0]-1]) >= int(H[tmp_int[1]-1]):
    R[tmp_int[1]]=False
  if int(H[tmp_int[0]-1]) <= int(H[tmp_int[1]-1]):
    R[tmp_int[0]]=False
    
print(R.count(True))
N, M = map(int, input().split())

H = list(map(int, input().split()))
F = [1 for _ in range(N)]
for _ in range(M):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    if H[a] >= H[b]:
        F[b] = 0
    if H[a] <= H[b]:
        F[a] = 0
print(sum(F))
N,M=map(int,input().split())
H=list(map(int,input().split()))
ans=[1]*N
for _ in range(M):
    A,B=map(int,input().split())
    if H[A-1]<=H[B-1]:
        ans[A-1]=0
    if H[B-1]<=H[A-1]:
        ans[B-1]=0
print(sum(ans))
N, M = [ int(i) for i in input().strip().split(' ') ]
H    = [ int(i) for i in input().strip().split(' ') ]
paths = []
max_neighbor = [ 0 for _ in range(N)]

for _m in range(M):
    path = input().strip().split(' ')
    path = int(path[0]), int(path[1])
    max_neighbor[path[0]-1] = max(max_neighbor[path[0]-1], H[path[1]-1])
    max_neighbor[path[1]-1] = max(max_neighbor[path[1]-1], H[path[0]-1])
count = 0
for n in range(N):
    if max_neighbor[n] < H[n]:
        count += 1
print(count)
n, m = map(int, input().split())
h = [int(x) for x in input().split()]
ans = [True] * n
for i in range(m):
    a, b = map(int, input().split())
    if h[a-1] < h[b-1]:
        ans[a-1] = False
    elif h[a-1] > h[b-1]:
        ans[b-1] = False
    else:
        ans[a-1] = False
        ans[b-1] = False
print(ans.count(True))
N,M=map(int, input().split())
H=list(map(int, input().split()))
V=[[] for _ in range(N)]
for m in range(M):
    a,b=map(int, input().split())
    a=a-1
    b=b-1
    V[a].append(b)
    V[b].append(a)
for v in V:
    v=set(v)
ans=[1]*N
tmp=0
for n in range(N):
    for v in V[n]:
        if H[n]<=H[v]:
            ans[n]=0
print(sum(ans))
# -*- coding: utf-8 -*-

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

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)
    elif h[a-1] > h[b-1]:
        s.add(b)
    else:
        s.add(a)

print(n-len(s))
n,m=map(int,input().split())
h=list(map(int,input().split()))
x=[1]*n
for i in range(m):
    a,b=map(int,input().split())
    if h[a-1]>=h[b-1]:
        x[b-1]=0
    if h[a-1]<=h[b-1]:
        x[a-1]=0
print(sum(x))
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
    elif h[a-1] == h[b-1]:
        ans[a-1] = ans[b-1] = 0
    else:
        ans[a-1] = 0
print(ans.count(1))
N, M = list(map(int, input().split()))
TENBOUDAI = list(map(int, input().split()))
# linked_list = { i: set() for i in range(N)}

_list = {i:1 for i in range(1,N+1)}
for m in range(M):
    i,j= list(map(int, input().split()))
    # if i in _list and j in _list:
    if TENBOUDAI[i-1] <= TENBOUDAI[j-1]:
        # _list.remove(i)
        _list[i] =0
    if TENBOUDAI[j-1] <= TENBOUDAI[i-1]:
        # _list.remove(j)
        _list[j] =0


# print(_list)
print(sum(_list.values()))
N, M = map(int, input().split())

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

S = [True]*N

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

print(sum(S))
n,m = map(int, input().split())
arr = [0]+list(map(int,input().split()))
g = [[] for i in range(n+1)]
for i in range(m):
  a,b = map(int, input().split())
  g[a].append(b)
  g[b].append(a)
  
ans = 0

for v in range(1, n+1):
  for u in g[v]:
    if arr[u]>=arr[v]:
      break
  else:
    ans+=1
    
print(ans)
N, M = map(int, input().split())
H = list(map(int, input().split()))

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

print(N-len(badN))
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)
  elif h[a-1] == h[b-1]:
    li.append(a)
    li.append(b)
  else:
    li.append(b)

answer = N - len(set(li))
print(answer)
import collections
N,M=map(int,input().split())    
H=list(map(int,input().split()))
ans=[1]*N
for _ in range(M):
    AB=list(map(int,input().split()))
    if H[AB[0]-1] < H[AB[1]-1]:
        ans[AB[0]-1]=0
    elif H[AB[0]-1] > H[AB[1]-1]:
        ans[AB[1]-1]=0
    else:
        ans[AB[0]-1]=0
        ans[AB[1]-1]=0
#c=collections.Counter(ans)
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 A[i] < h[i]:
        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[a-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)
# C - Peaks

N, M = map(int, input().split())
H = list(int(x) for x in input().split())
G = [[] for _ in range(N)]
for i in range(M):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    G[a].append(b)
    G[b].append(a)

ans = [1] * N

for i in range(N):
    for j in G[i]:
        if H[i] <= H[j]:
            ans[i] = 0
            break

print(sum(ans))
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())
  if H[a-1] == H[b-1]:
    L[a-1] = 0
    L[b-1] = 0
  elif H[a-1] < H[b-1]:
    L[a-1] = 0
  elif H[a-1] > H[b-1]:
    L[b-1] = 0
print(sum(L))
n,m=map(int,input().split())
h=list(map(int,input().split()))
lower=[0]*n
for i in range(m):
    a,b=map(int,input().split())
    if h[a-1] <= h[b-1]:
        lower[a-1] += 1
    if h[a-1] >= h[b-1]:
        lower[b-1] += 1
print(lower.count(0))
N,M = map(int,input().split())
H = list(map(int,input().split()))
lst = [ list(map(int,input().split())) for _ in range(M)]
hill = []
for i in range(N):
    hill.append([])

for i in range(M):
    hill[lst[i][0]-1].append(lst[i][1])
for j in range(M):
    hill[lst[j][1]-1].append(lst[j][0])


cnt = 0

for k in range(N):
    tmp = True
    for l in hill[k]:
        if H[k] <= H[l-1]:
            tmp = False
    if tmp:
        cnt += 1

print(cnt)
n,m  = map(int, input().split())
ten = list(map(int, input().split()))
arr = [list(map(int,input().split())) for i in range(m)]
hikui = []
for i in arr:
    if ten[i[0]-1]<ten[i[1]-1]:
        hikui.append(i[0])
    elif ten[i[1]-1]<ten[i[0]-1]:
        hikui.append(i[1])
    else:
        hikui.append(i[0])
        hikui.append(i[1])
ans = n-len(set(hikui))

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

h = [int(x) for x in input().split(' ')]
o = ['Good'] * n

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

print(o.count('Good'))
n, m= map(int, input().split())
h = list(map(int, input().split()))

e = [[] for _ in range(n)]

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

ans = 0
for j in range(n):
    if not e[j]:
        ans += 1
        continue
    hs = [h[k] for k in e[j]]
    if h[j] > max(hs):
        ans += 1
print(ans)
n, m = map(int, input().split())
h = list(map(int, input().split()))
edges = [tuple(map(int, input().split())) for _ in range(m)]

good_obs = [True] * n
for a, b in edges:
    if h[a - 1] >= h[b - 1]:
        good_obs[b - 1] = False
    if h[a - 1] <= h[b - 1]:
        good_obs[a - 1] = False
print(sum(good_obs))