Harryxun/stf_run huggingface dataset:
a = int(input())
b = int(input())
count=0
for i in range(a,b+1):
    test = list(str(i))
    if (test[0] == test[4]) and (test[1]==test[3]):
        count=count+1
print(count)

### FIXED CODE ###

a , b = input().split()
a = int(a)
b = int(b)
count=0
for i in range(a,b+1):
    test = list(str(i))
    if (test[0] == test[4]) and (test[1]==test[3]):
        count=count+1
print(count)
import numpy as np
n=int(input())
a=[int(x) for x in input().split()]

matrix=np.zeros((n,n))

for i in range(n-1):
  matrix[i,i:i+2]+=1
matrix[-1,0]+=1
matrix[-1,-1]+=1

X = 2*np.linalg.solve(matrix, np.array(a)).astype(int)

print(*X)


### FIXED CODE ###

from scipy.sparse import csr_matrix
from scipy.sparse.linalg import spsolve
import numpy as np

N = int(input())
A = np.array(input().split())

#値の入る座標の準備
rows = np.concatenate([np.arange(N), np.arange(N)])
cols = np.concatenate([np.arange(N), np.arange(1,N+1) % N])

#疎行列の作成
#csr_matrix((値だけのlist, 値の入る座標を示すtulpe:(rows, cols) ), 大きさ (N,N))
mat = csr_matrix(([1] * (2*N), (rows, cols)), (N,N))
#print(rows,cols,mat)
 
answer = (spsolve(mat,A) * 2).astype(int)
print(*answer)
r, g, b = input().split()
print('YES' int(g+b)%4==0 else 'NO')

### FIXED CODE ###

r, g, b = input().split()
print('YES' if int(g+b)%4==0 else 'NO')
from collections import defaultdict

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

color = [None] * (n + 1)
for i in range(n + 1):
    color[i] = i

def root(x):
    global color

    if color[x] == x:
        return x
    return root(color[x])

def unite(x, y):
    rx = root(x)
    ry = root(y)
    if rx == ry:
        return
    color[rx] = ry

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

cnt = defaultdict(int)
for i in range(n):
    cnt[root(i + 1)] += 1
print(max(cnt.values()))

### FIXED CODE ###

import sys
from collections import defaultdict
sys.setrecursionlimit(10 + 2 * 10 ** 5)
 
n, m = map(int, input().split())
 
color = [None] * (n + 1)
for i in range(n + 1):
    color[i] = i
 
def root(x):
    global color
 
    if color[x] == x:
        return x
    color[x] = root(color[x])
    return color[x]
 
def unite(x, y):
    rx = root(x)
    ry = root(y)
    if rx == ry:
        return
    color[rx] = ry
 
for i in range(m):
    a, b = map(int, input().split())
    unite(a, b)
 
cnt = defaultdict(int)
for i in range(n):
    cnt[root(i + 1)] += 1
print(max(cnt.values()))
import math 

n = int(input())
t = [ int(input()) for i in range(n)]
def lc(a,b):
    return a // math.gcd(a,b) * b

def lcm(b):
    ans = b[0]
    for i in b:
        ans = lc(ans,i)
    return ans
print(lcm(t))



### FIXED CODE ###


n = int(input())
t = [ int(input()) for i in range(n)]
def gcd(a,b):
    if a<b:a,b = b,a 
    if b==0:return a
    else : return gcd(b,a%b)    

def lc(a,b):
    return a //gcd(a,b) * b

def lcm(b):
    ans = b[0]
    for i in b:
        ans = lc(ans,i)
    return ans
print(lcm(t))
import sys
from functools import reduce
X, Y = map(int, input().split())
mod = 10**9 + 7

if (X+Y)%3 != 0:
    print(0)
    sys.exit()

def f(n, A):
    bunsi = reduce(lambda x, y: x*y%mod, range(n, n-A, -1))
    bunbo = reduce(lambda x, y: x*y%mod, range(1, A+1))
    return bunsi * pow(bunbo, mod-2, mod) % mod

ans = 0
r, d = 0, 0
if X == Y:
    r, d = X//3, Y//3
    ans = f(r+d, min(r, d))%mod
else:
    r = abs(X-Y) + ((X+Y) - 3*abs(X-Y))//3
    d = ((X+Y) - 3*abs(X-Y))//3
    ans = f(r+d, d)%mod

print(ans)

### FIXED CODE ###

import sys
from functools import reduce
X, Y = map(int, input().split())
mod = 10**9 + 7

if (X+Y)%3 != 0:
    print(0)
    sys.exit()

if 2 * min(X, Y) < max(X, Y):
    print(0)
    sys.exit()

def f(n, A):
    bunsi = reduce(lambda x, y: x*y%mod, range(n, n-A, -1))
    bunbo = reduce(lambda x, y: x*y%mod, range(1, A+1))
    return bunsi * pow(bunbo, mod-2, mod) % mod

ans = 0
r, d = 0, 0
if X == Y:
    r, d = X//3, Y//3
    ans = f(r+d, d)%mod
else:
    r = abs(X-Y) + ((X+Y) - 3*abs(X-Y))//6
    d = ((X+Y) - 3*abs(X-Y))//6
    if d == 0:
        print(1)
        sys.exit()
    ans = f(r+d, d)%mod

print(ans)
ab = (int(i) for i in input().sprit())
print("Even" if ab[0]%2==0||ab[1]%2==0 else"Odd")

### FIXED CODE ###

ab = list(int(i) for i in input().split())
print("Even" if (ab[0] % 2 == 0 or ab[1] % 2 == 0) else "Odd")
M, K = map(int, input().split())

tmp = 0
X = list(range(K)) + list(range(K+1, 2**M))
for i in X:
    tmp ^= i

if tmp == K:
    ans = X + [K] + X[::-1] + [K]
    print(*ans)
elif K == 0:
    ans = []
    for i in range(2**M):
        ans += [i]*2
    print(*ans)
else:
    print(-1)

### FIXED CODE ###

M, K = map(int, input().split())

if M == 1:
    if K == 0:
        print("1 1 0 0")
    else:
        print(-1)
elif 2**M > K:
    X = list(range(K)) + list(range(K+1, 2**M))
    ans = " ".join(map(str, X + [K] + X[::-1] + [K]))
    print(ans)
else:
    print(-1)
odd = list(map(str, input()))
even = list(map(str, input()))
L=len(odd)*2
li=[]

for i in range(1,L+1):
  if i%2==1:
    if i==1:
      li.append(odd[0])
    else:
      li.append(odd[i//2])
  else:
    li.append(even[i//2-1])
    
print(''.join(li))

### FIXED CODE ###

odd = list(map(str, input()))
even = list(map(str, input()))
if len(odd)==len(even):
  L=len(odd)*2
else:
  L=len(odd)+len(even)
li=[]

for i in range(1,L+1):
  if i%2==1:
    if i==1:
      li.append(odd[0])
    else:
      li.append(odd[i//2])
  else:
    li.append(even[i//2-1])
    
print(''.join(li))
#!/bin/bash
''':'
docker run --rm -it -v $(cd $(dirname $0) && pwd):/vo:ro pypy:3-2.4.0 /bin/bash -c "pypy3 /vo/$(basename $0) < /vo/g.inp"; exit $?
exit 0
'''
import sys
import math

def _i(): return int(sys.stdin.readline().strip())
def _ia(): return [ int(x) for x in sys.stdin.readline().strip().split() ]

h,w = _ia()
ab = []
for _ in range(h): ab.append(_ia())
for i in range(h):
    r = ab[i]
    for j,bj in enumerate(_ia()):
        r[j] = abs(r[j] - bj)
#        
def search(ab,i,j,now=0):
    if i==-1 or j==-1: return math.inf
    if i==0 and j==0:
        ret = ab[0][0]
        if now>0: return abs(now - ret)
        else: return abs(now + ret)
    #
    x = ab[i][j]
    t1 = search(ab,i-1,j,now+x)
    t2 = search(ab,i-1,j,now-x)
    t3 = search(ab,i,j-1,now+x)
    t4 = search(ab,i,j-1,now-x)
    return min(t1,t2,t3,t4)

h1 = h - 1
w1 = w - 1
print(search(ab,h1,w1))


### FIXED CODE ###

#!/bin/bash
''':'
docker run --rm -it -v $(cd $(dirname $0) && pwd):/vo:ro pypy:3-2.4.0 /bin/bash -c "pypy3 /vo/$(basename $0) < /vo/g.inp"; exit $?
exit 0
'''
import sys

def _ia(): return [ int(x) for x in sys.stdin.readline().strip().split() ]

# read input
h,w = _ia()
ab = []
for _ in range(h): ab.append(_ia())
for i in range(h):
    r = ab[i]
    for j,bj in enumerate(_ia()):
        r[j] = abs(r[j] - bj)
    t = max(r)

# initialize
dp = [[None for _ in range(w)] for _ in range(h)]
dp[0][0] = {ab[0][0]}
hw1 = h + w - 1
for ij in range(1,hw1):
    iend = ( hw1 - ij ) * 80
    for i in range(min(ij+1,h)):
        j = ij - i
        if j>=w: continue
        #
        ref = set()
        if i>0: ref|= dp[i-1][j]
        if j>0: ref|= dp[i][j-1]
        #
        x = ab[i][j]
        nxt = dp[i][j] = set()
        for idx in ref:
            ix = abs(idx-x)
            if ix<=iend: nxt.add(ix)
            ix = idx + x
            if ix<=iend: nxt.add(ix)
            
# stdout
print(min(dp[h-1][w-1]))
X = input().split()
X = int(X[0])
ans = [0]*2

for i in range(200):
    A5 = X+i**5
    ans[0] = pow(A5,0.2)
    if ans[0].is_integer():
        ans[0] = int(ans[0])
        ans[1] = int(i)
        break
    A5 = X-i**5
    ans[0] = pow(A5,0.2)
    if ans[0].is_integer():
        ans[0] = int(ans[0])
        ans[1] = -int(i)
        break

print(' '.join(map(str,ans)))

### FIXED CODE ###

X = input().split()
X = int(X[0])
ans = [0]*2

for i in range(-200,200):
    for j in range(-200,200):
        x = i**5 - j**5

        if x == X:
            ans = (i,j)
            break

print(' '.join(map(str,ans)))
import math
# Calculate amount of water that won't oveflow
def calc(a,b,deg): 
    
    rad = math.radians(deg)
    deg90_in_rad = math.radians(90)
    a_sect = a*math.sin(rad) - b*math.sin(deg90_in_rad - rad)
    b_sect = b*math.sin(deg90_in_rad - rad) - a*math.sin(rad) # 縦と水の切片

    if b_sect >= 0:
        sqr_a = a * b_sect 
        tri_a = (b-b_sect)*a*1/2  

    else:
        sqr_a = 0
        tri_a = (a - a_sect) * b *1/2

    # if b*math.tan(math.pi/2-rad)>a:
    #     return (a*b - a*math.tan(rad)*a*1/2) *a
    # else:
    #     return (b*math.tan(rad/2-rad)*b*1/2)*a
    # print(a_sect, b_sect)
    return (sqr_a + tri_a) * a

import bisect
def main():
    a, b, x = list(map(int, input().split()))

    left = 0
    right = 90
    deg = 45
    while True:
        y = calc(a, b, deg)
        if y - x <= 0 and y - x >= -10 ** -7 :
            break
        if y > x:
            deg, left = (right+deg)/2, deg
        elif y < x:
            deg, right = (left+deg)/2, deg
        
    print(deg)

if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys

for line in sys.stdin:
    A, B = list(map(int, line.split(' ')))


    if 1 <= A <= 9 and 1 <= B <= 9:
        out = A*B
        print(out)
    else:
        print(-1)
# 0〜9
l=list(range(10))

# 入力
N,K=map(str,input().split())
l2=list(map(int,input().split()))

ans=''
f=False

# 使用可能な数字を求める
for x in l2:
  l.remove(x)

# Nと桁数が一致する場合
if int(N[0])<l[-1]:
  for i in range(len(N)):
    for x in l:
      if f:
        ans+=str(x)
        break
      elif int(N[i])<x:
        f=True
        ans+=str(x)
        break
      elif int(N[i])==x:
        ans+=str(x)
        break
# Nと桁数が一致する可能性がある場合
elif int(N[0])==l[-1]:
  l3=list(N[1:])
  l3=list(map(int,set(l3)))
  l3.sort()

  # Nと桁数が一致しない
  if l3[-1]>l[-1]:
    # 最上位は0以外の最小の数にする
    if l[0]==0:
      ans+=str(l[1])
      ans+='0'*int(N)
    else:
      ans+=str(l[0])*(N+1)

  # Nと桁数が一致する
  else:
    for i in range(len(N)):
      for x in l:
        if f:
          ans+=str(x)
          break
        elif int(N[i])<x:
          f=True
          ans+=str(x)
          break
        elif int(N[i])==x:
          ans+=str(x)
          break

# Nと桁数が一致しない場合
else:
  # 最上位は0以外の最小の数にする
  if l[0]==0:
    ans+=str(l[1])
    ans+='0'*int(N)
  else:
    ans+=str(l[0])*(N+1)

# 出力
print(ans)

### FIXED CODE ###

l=[str(x) for x in range(100000)]
n,k=map(int,input().split())
l2=list(map(str,input().split()))
ind=l.index(str(n))
while True:
  a=l[ind]
  f=False
  for x in l2:
    if x in a:
      f=True
  if not f:
    break
  ind+=1
print(a)
x=input().split()
a=int(x[0])
b=int(x[1])

if 1<=a and a<=100 and 1<=b and b<=100:
  area=a*b
  cir=(a+b)*2
  print(area,cir)
else:
  print("error")


### FIXED CODE ###

x=input().split()
a=int(x[0])
b=int(x[1])

if 1<=a and a<=100 and 1<=b and b<=100:
  area=a*b
  cir=(a+b)*2
  print(area,cir)
else:
  print("error")
n = int(input())

a = sorted([int(i) for i in input().split()])
b = sorted([int(i) for i in input().split()])
c = sorted([int(i) for i in input().split()])

ans = 0
for i in b:
    x = bisect.bisect(c,i)
    y = bisect.bisect_left(a,i)
    ans += (n-x) * y
    
print(ans)



### FIXED CODE ###

import bisect
n = int(input())

a = sorted([int(i) for i in input().split()])
b = sorted([int(i) for i in input().split()])
c = sorted([int(i) for i in input().split()])

ans = 0
for i in b:
    x = bisect.bisect(c,i)
    y = bisect.bisect_left(a,i)
    ans += (n-x) * y
    
print(ans)
n = int(input())
s = input()
ans = 0
cur = 0
for c in s:
	if c == 'I':
		cur += 1
        ans = max(ans, cur)
    else:
		cur -= 1
          
print(ans)

### FIXED CODE ###

n = int(input())
s = input()
ans = 0
cur = 0
for c in s:
    if c == 'I':
        cur += 1
        ans = max(cur, ans)
    else:
        cur -= 1

print(ans)
#!/usr/bin/env python3
#A
import numpy as np
import math
import re

a,b = map(int,input().split())

c = [list(map(str,input().split()))for i in range(a)]
d = [[0 for j in range(b)]  for i in range(a)]
e = [[0 for j in range(b)]  for i in range(a)]#コピー用
#print(c,d,e)

for i in range(a):#初期のリスト設定
    for j in range(b):
        if c[i][0][j] == '#':
            d[i][j] = 1
            e[i][j] = 1
#print(c,d,e)

def check(list,a,b):#全て1であるかの判定
    for i in range(a):
        for j in range(b):
            if list[i][j] == 0:
                return False
    return True

def copy(list1,list2,a,b):
    for i in range(a):
        for j in range(b):
            if list2[i][j] == 1:
                list1[i][j] = 1


count = 0
while not check(d,a,b):
    count += 1
    for i in range(a):
        for j in range(b):
            if d[i][j] == 1:
                if i != 0:#上があるなら
                    e[i-1][j] = 1
                if j != 0:#左があるなら
                    e[i][j-1] = 1
                if i != a-1:#下があるなら
                    e[i+1][j] = 1
                if j != a-1:#右があるなら
                    e[i][j+1] = 1
    copy(d,e,a,b)
    check(d,a,b)
print(count)

### FIXED CODE ###

#!/usr/bin/env python3
#AGC33 A

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

h,w = LI()
maze = [list(input()) for _ in range(h)]
check = [[True]*w for _ in range(h)]
dx,dy = [0,1,0,-1],[1,0,-1,0]
que = deque()
for i in range(h):
    for j in range(w):
        if maze[i][j] == '#':
            check[i][j] = False
            que.append((j,i))
res = 0
while que:
    que2 = deque(que)
    que = deque()
    flg = False
    while que2:
        x,y = que2.popleft()
        for i in range(4):
            nx,ny = x + dx[i], y + dy[i]
            if 0 <= nx < w and 0 <= ny < h:
                if check[ny][nx]:
                    check[ny][nx] = False
                    que.append((nx,ny))
                    flg = True
    if flg:
        res += 1
print(res)
import math

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
list1 = [A,B,C,D,E]
list2 = [i%10 for i in list1]
min_item=9
for i in range(1,10):
    if i in list2:
        min_item = min(min_item,i)
min_index = list2.index(min_item)
total_time = 0
time_seq =[]

for i in range(5):
    if i == min_index:
        continue
    time1 = math.ceil(list1[i]/10) * 10
    total_time += time1
    time_seq.append(time1)
    
total_time += list1[min_index]
print(int(total_time))

### FIXED CODE ###

import math

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
list1 = [A,B,C,D,E]
list2 = [i%10 for i in list1]
min_item=max(list2)
for i in range(1,10):
    if i in list2:
        min_item = min(min_item,i)
min_index = list2.index(min_item)
total_time = 0
time_seq =[]

for i in range(5):
    if i == min_index:
        continue
    time1 = math.ceil(list1[i]/10) * 10
    total_time += time1
    time_seq.append(time1)
    
total_time += list1[min_index]
print(int(total_time))
import math

A, B, C, D = map(int, input().split(" "))
r = B - A + 1
n_C = round(r / C)
n_D = round(r / D)
n_CD = round(r / ((C * D) // math.gcd(C, D)))
print(r - (n_C + n_D - n_CD))


### FIXED CODE ###

from fractions import gcd


def wari(x, c, d):
    nc = x // c
    nd = x // d
    ncd = x // ((c * d) // gcd(c, d))
    return x - nc - nd + ncd


A, B, C, D = map(int, input().split())

nb = wari(B, C, D)
na = wari(A - 1, C, D)
print(nb - na)
import itertools
N, M, Q = map(int, input().split())
a = [list(map(int, input().split())) for l in range(Q)]
b = [1]*N
c = 0
for i in range(Q):
  if b[a[i][2]-1]-b[a[i][1]-1] == a[i][3]:
    c += a[i][4]
C = c
for k in range(1,M):
  nums = [i for i in range(N-1)]
  for balls in itertools.combinations_with_replacement(nums, k):
    b = [1]*N
    c = 0
    for i in range(1,N):
      b[i] = b[i-1] + balls.count(i-1)
    for i in range(Q):
      if b[a[i][1]-1]-b[a[i][0]-1] == a[i][2]:
        c += a[i][3]
    C = max(C,c)
print(C)

### FIXED CODE ###

import itertools
N, M, Q = map(int, input().split())
a = [list(map(int, input().split())) for l in range(Q)]
b = [1]*N
c = 0
for i in range(Q):
  if b[a[i][1]-1]-b[a[i][0]-1] == a[i][2]:
    c += a[i][3]
C = c
for k in range(1,M):
  nums = [i for i in range(N-1)]
  for balls in itertools.combinations_with_replacement(nums, k):
    b = [1]*N
    c = 0
    for i in range(1,N):
      b[i] = b[i-1] + balls.count(i-1)
    for i in range(Q):
      if b[a[i][1]-1]-b[a[i][0]-1] == a[i][2]:
        c += a[i][3]
    C = max(C,c)
print(C)
input_ = input()

input_str = set(input_)

input_str_arr = [s for s in input_str]

if input_.count(inpute_str_arr[0]) and input_.count(inpute_str_arr[0]):
  print("Yes")
else:
  print("No")


### FIXED CODE ###

def consunt():
    if input_.count(input_str_arr[0]) and input_.count(input_str_arr[1]):
      print("Yes")
    else:
      print("No")

input_ = input()

input_str = set(input_)

input_str_arr = [s for s in input_str]

if len(set(input_str_arr))==2:
    consunt()
else:
    print("No")
s = input().split()
print(s.index['0'])

### FIXED CODE ###

s = input().split()
print(s.index('0')+1)
A, B, C = map(int, input().split())
if (A[-1]==B[0]) and (B[-1]==C[0]):
  print('YES')
else:
  print('NO')

### FIXED CODE ###

A, B, C = input().split()
if (A[-1]==B[0]) and (B[-1]==C[0]):
  print('YES')
else:
  print('NO')
a,b,c = map(input().split())
print(sum([c%x==0 for x in(a,b+1)])

### FIXED CODE ###

a,b,c = map(int,input().split())
d=0
for x in range(a,b+1):
    if c%x==0:d+=1
print(d)
a, b, c, n = map(int, input().split())
if a >= n:
    print(n)
elif n > a and a + b >= n:
    print(a)
else
    print(a - (n - a))

### FIXED CODE ###

a, b, c, n = map(int, input().split())
if a >= n:
    print(n)
elif n > a and a + b >= n:
    print(a)
else:
    print(a + a - n + b)
a,b=map(int,input().split())

alllist=[]
for i in range(b):
    tmp=list(map(int,input().split())
    alllist.append(tmp)

for chk in range(a):
    print(list.alllist(chk+1))

### FIXED CODE ###

a,b=map(int,input().split())

alllist=[]

for i in range(b):
    tmp=list(map(int,input().split()))
    alllist.extend(tmp)

for chk in range(a):
    print(alllist.count(chk+1))
n = int(input())
li_a = []
b=0
for i in range(n):
    temp = input()
    if temp == "2":
        li_a.sort()
        if len(li_a)%2 == 0:
            ans_a = li_a[len(li_a)//2-1]
        else:
            ans_a = li_a[(len(li_a)-1)//2]
        ans_b = 0
        for a in li_a:
            ans_b += abs(a-ans_a)
        ans_b += b
        print(ans_a,ans_b)
    else:
        z,aa,bb=temp.split(" ")
        li_a.append(int(aa))
        b+=int(bb)


### FIXED CODE ###

from collections import deque

a,b = map(int,input().split()) 
a=sorted(list(map(int,input().split())))
di = {}
for i in range(b):
    x,y = map(int,input().split()) 
    if y in di:
        di[y] += x
    else:
        di[y] = x
keys = sorted(list(di.keys()))
keys.reverse()
# print(keys)
ichi = 0
# print(a)
for i in range(len(a)):
    try:
        if keys[ichi] > a[i]:
            a[i] = keys[ichi]
            di[keys[ichi]] -= 1
        else:
            break
        if di[keys[ichi]] == 0:
            ichi += 1
    except:
        pass
# print(a)
print(sum(a))
while True:
    n = int(input())
    if n == 0:break
    sum_a = sum_b = 0
    for i in range(n):
        a,b = map(int, raw_input().split())
        if a > b:sum_a = sum_a + a + b
        elif a < b:sum_b = sum_b + a + b
        else:
            sum_a = sum_a + a
            sum_b = sum_b + b
    print(sum_a,sum_b)


### FIXED CODE ###

while 1:
    n = int(input())
    if n == 0:
        break
    
    sum_a = 0
    sum_b = 0
    
    for i in range(n):
        a,b = map(int, input().split())
        
        if a > b:
            sum_a = sum_a + a + b
        elif a < b:
            sum_b = sum_b + a + b
        elif a == b:
            sum_a = sum_a + a
            sum_b = sum_b + b

    print(sum_a,sum_b)
s = input()
t = input()
print(sum[s[i] == t[i] for i in range(3)])

### FIXED CODE ###

s = input()
t = input()
print(sum(s[i] == t[i] for i in range(3)))
vn, m = list(map(int, input().split()))
hs =  list(map(int, input().split()))
ans = [1]*n
for i in range(m):
    road = list(map(int, input().split()))
    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(0))


### FIXED CODE ###

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))
if N < 10 ** 1:
    print(N)
elif N < 10 ** 2:
    print(9)
elif N < 10 ** 3:
    print(N - 90)
elif N < 10 ** 4:
    print(909)
elif N < 10 ** 5:
    print(N - 9090)
else:
     print(90909)

### FIXED CODE ###

N = int(input())
if N < 10:
    print(N)
elif N < 100:
    print(9)
elif N < 1000:
    print(N - 90)
elif N < 10000:
    print(909)
elif N < 100000:
    print(N - 9090)
else:
     print(90909)
A = np.zeros((N+1,S+1,3),dtype=np.int16)


### FIXED CODE ###

N,M = map(int,input().split())
print(N*(N-1)//2+(M*(M-1))//2)
import sys

y = sys.stdin.readline()
y = int(y)

x = sys.stdin.readline()

x_list = int(x.split(" "))

for i in range(1, y):
  if x_list[i] < x_list[i - 1]:
    for j range(i - 1, -1):
      if x_list[j] < x_list[i]:
        x_list[i],  x_list[j+1] = x_list[j+1], x_list[i]
        break
  for k in range(0, y):
    print x_list[k]

### FIXED CODE ###

import sys

def insertionSort(x_list,y):
  for i in range(1, y):
    v = x_list[i]
    j = i - 1
    while j >= 0 and x_list[j] > v:
      x_list[j + 1] = x_list[j]
      j -= 1
    x_list[j+1] = v
    for k in range(0, y):
      print x_list[k],
    print

y = sys.stdin.readline()
y = int(y)

x = sys.stdin.readline()

x_list = x.split(" ")

for i in range(y):
  x_list[i] = int(x_list[i])

for k in range(0, y):
  print x_list[k],
print

insertionSort(x_list, y)
def isprime_euclid2(N):
    if N<1:
        print 'N>2'
    elif N==2:
        return True
        
    import math
    def euclid(m,n):
        while m%n>0:
            r=m%n
            m,n=n,r
        else:
            return n
        
    euclid_list=[]
    for k in range(1,int(round(math.sqrt(N)))+1):
        euclid_list.append(euclid(N,k))
    temp=set(euclid_list)
    if len(temp)==1:
        return True
    else:
        return False     

while True:
    n = int(raw_input())
    total = 0
    for k in range(n):
        if isprime_euclid2(int(raw_input())):
            total +=1
    print total

### FIXED CODE ###

import math
def is_prime(n):
    if n % 2 == 0 and n > 2: 
        return False
    return all(n % i for i in range(3, int(math.sqrt(n)) + 1, 2))
                      
while True:
    try:
        n = int(raw_input())
        total = 0
        for k in range(n):
            if is_prime(int(raw_input())):
                total +=1
        print total
    except EOFError:
        break
def euclidean(a,b):
  _ = a % b
  while 1:
    if b % _ == 0:
      break
    else:
      _ = b % _
    return _
 
A, B, K = map(int, input().split())
 
a = max(A, B)
b = min(A, B)
e = euclidean(a, b)
 
by = []
r = int(e ** (1 / 2))
 
for i in range(1, r + 1):
  if e % i == 0:
    by.append(i)
    j = e // i
    if j != i:
      by.append(j)
by.sort(reverse = True)
print(by[K - 1])

### FIXED CODE ###

def euclidean(a,b):
  _ = a % b
  if _ == 0:
    return b
  else:
    while 1:
      if b % _ == 0 :
        break
      else:
        _ = b % _
    return _
  
A, B, K = map(int, input().split())
 
a = max(A, B)
b = min(A, B)
e = euclidean(a, b)
by = []
r = int(e ** (1 / 2))
 
for i in range(1, r + 1):
  if e % i == 0:
    by.append(i)
    j = e // i
    if j != i:
      by.append(j)
by.sort(reverse = True)
print(by[K - 1])