Harryxun/stf_run huggingface dataset:
n = int(input())
a = list(map(int, input().split()))

def gcd(a, b):
    if min(a, b) == 0:
        return max(a, b)
    while b:
        a, b = b, a % b
    return a

def l(i):
    if i == 0:
        return 0
    else:
        return gcd(l(i-1), a[i-1])

def r(i):
    if i == n:
        return 0
    else:
        return gcd(r(i+1), a[i])

gcd_max = 1
for i in range(n):
    i_gcd = gcd(l(i), r(i+1))
    if i_gcd > gcd_max:
        gcd_max = i_gcd

print(gcd_max)


### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))

def gcd(a, b):
    if min(a, b) == 0:
        return max(a, b)
    while b:
        a, b = b, a % b
    return a

l = [0]
r = [0]
for i in range(n):
    l.append(gcd(l[i], a[i]))
    r.append(gcd(r[i], a[n-i-1]))

r = r[::-1]

ans = 0
for i in range(n):
    g = gcd(l[i], r[i+1])
    ans = max(ans, g)

print(ans)
import re;a,b=re.findall('. .',input());print('YNEOS'[a[0]+b[2]!=a[2]+b[0]::2])

### FIXED CODE ###

a,b,c=input().split();print('YNEOS'[a[::-1][0]!=b[0]or b[::-1][0]!=c[0]::2])
n,k = map(int,input().split())
a=[]
for i in range(n):
	a.append(int(input()))

sa = sorted(a)
v=1000000
for i in range(n-k+1):
	if v > sa[i+k-1]-sa[i] 
		v = sa[i+k-1]-sa[i]
print(v)

### FIXED CODE ###

n,k = map(int,input().split())
a=[]
for i in range(n):
	a.append(int(input()))

sa = sorted(a)
v=10**9
for i in range(n-k+1):
	if v > sa[i+k-1]-sa[i]:
		v = sa[i+k-1]-sa[i]
print(v)
import collections
n=int(input())
v=[int(i) for i in input().split(' ')]

v_odd = v[1::2]
v_even = v[0::2]

vo = collections.Counter(v_odd).most_common()
ve = collections.Counter(v_even).most_common()

# 最大の値が同じ場合
if vo[0][0] == ve[0][0]:
    # 奇数のほうが少ない場合
    if vo[0][1] > ve[0][1]:
        result = len(v_odd) - vo[0][1] + len(v_even) - ve[1][1]
    elif vo[0][1] < ve[0][1]:
        result = len(v_odd) - vo[1][1] + len(v_even) - ve[0][1]
    else:
        result = len(v_odd) - vo[0][1] + len(v_even) 
else:
    result = len(v_odd) - vo[0][1] + len(v_even) - ve[0][1]

print(result)

### FIXED CODE ###

n=input()
n = n.replace('1','a')
n = n.replace('9','b')
n = n.replace('a','9')
n = n.replace('b','1')
print(n)
n, m, x = map(int,input().split())

a = [[0 for i in range(m)] for _ in range(n)]
c = [0] * n
for sankousyo in range(n):
    c_and_a = list(map(int,input().split()))
    c[sankousyo] = c_and_a[0]
    a[sankousyo] = c_and_a[1:]
    
cost = [0] * (2**n)
INF = 10**12
res_cost = INF
for i in range(2**n):
    understandings = [0] * m
    cost_sum = 0
    for j in range(n):
        if (i >> j) & 1:

            cost_sum += c[j]
            
            for k in range(m):
                understandings[k] = understandings[k] + a[j][k]

    res = True
    for j in range(n):
        if understandings[j] < x:
            res = False 

    if res:
        if res_cost > cost_sum:
            res_cost = cost_sum

if res_cost == INF:
    print(-1)
else:
    print(f"お会計は{res_cost}円です")


### FIXED CODE ###

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

a = [[0 for i in range(m)] for _ in range(n)]
c = [0] * n
for sankousyo in range(n):
    c_and_a = list(map(int,input().split()))
    c[sankousyo] = c_and_a[0]
    a[sankousyo] = c_and_a[1:]
    
cost = [0] * (2**n)
INF = 10**12
res_cost = INF
for i in range(2**n):
    understandings = [0] * m
    cost_sum = 0
    for j in range(n):
        if (i >> j) & 1:

            cost_sum += c[j]
            
            for k in range(m):
                understandings[k] = understandings[k] + a[j][k]

    res = True
    for j in range(m):
        if understandings[j] < x:
            res = False 

    if res:
        if res_cost > cost_sum:
            res_cost = cost_sum

if res_cost == INF:
    print(-1)
else:
    print(res_cost)
i=input()
i.splitlines()
ls=list(range(1,3))
ls.remove(i[0])
ls.remove(i[1])
a=ls.pop()
print(a)


### FIXED CODE ###

i=int(input())
j=int(input())
a=6-(i+j)
print(str(a))
import math
A,B,C,D = map(int, input().split())

A = A-1
c_and_d=C*D
#CとDの最小公倍数を求める
lcm = int(C*D/math.gcd(C,D))
# print('最小公倍数:',lcm)

count_C =0
count_D =0
count_C_and_D =0

count_C = int(B/C)-int(A/C)
count_D = int(B/D)-int(A/D)
count_C_and_D = int(B/lcm)-int(A/lcm)
A = A+1
# print(A,B,count_C , count_D , count_C_and_D)
print((B-A+1) -(count_C + count_D - count_C_and_D))

### FIXED CODE ###

import fractions

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


c_and_d=C*D
#CとDの最小公倍数を求める
lcm = int(C*D//fractions.gcd(C,D))


count_C =0
count_D =0
count_C_and_D =0

count_C = int(B//C)-int((A-1)//C)
count_D = int(B//D)-int((A-1)//D)
count_C_and_D = int(B//lcm)-int((A-1)//lcm)

print(int((B-A+1) -(count_C + count_D - count_C_and_D)))
s = str(input())
n = len(s)
if ((n+1)/2)%2 != 0:
  if (s[i-1] == s[n-i] for i in range(1,(n+1)/2)) and (s[j-1] == s[((n-1)/2)-j] for j in range(1,(n+3)/4)) and (s[(n+2*k-1)/2] == s[n-k] for k in range(1,(n+3)/4)):
    print('Yes')
  else:
    print('No')
else:
  if (s[i-1] == s[n-i] for i in range(1,(n+1)/2)) and (s[j-1] == s[(n-2*j-1)/2] for j in range(1,(n+1)/4)) and (s[(n+2*k-1)/2] == s[n-k] for k in range(1,(n+1)/4)):
    print('Yes')
  else:
    print('No')

### FIXED CODE ###

s = str(input())
n = len(s)
s1 = s[:int((n-1)/2)]
if s != s[::-1] or s1 != s1[::-1]:
  print('No')
else:
  print('Yes')
n = int(input())
A = list(map(int, input().split()))
while a % 2 == 0 in A:
  a /= 2
  count += 1
print(count)

### FIXED CODE ###

N = int(input())
a = list(map(int, input().split()))
 
i = 0
odd = 0
while odd == 0:
    for n in range(N):
        if a[n] % 2 == 0:
            a[n] /= 2
        else:
            odd = 1
            break
    if odd == 0:
        i += 1
print(i)
s = input()
q = int(input())
rev = 1
for i in range(q):
  t = input()
  
  if t == '1':
    rev *= -1
  else:
    x,y,sr = t.split()
    if rev == 1 and y == '2':
      s = s + sr
    else:
      s = sr + s

if rev == -1:
  s = s[::-1]
  
print(s)  

### FIXED CODE ###

s = input()
n = len(s)
sa = 'A'*n
sb = 'B'*n

if s != sa and s != sb:
  print('Yes')
else:
  print('No')
N,W = map(int,input().split())
w = [0]*N
v = [0]*N
for i in range(N):
    w[i],v[i] = map(int,input().split())

dp = [[0]*(W+1) for i in range(N+1)]

for i in range(1,N+1):
    for j in range(W+1):
        if w[i-1] <= j:
            dp[i][j] = max(dp[i-1][j],dp[i-1][j-w[i-1]] + v[i-1])
        else:
            dp[i][j] = dp[i-1][j]
            
print(dp[-1][-1])

### FIXED CODE ###

n, W = map(int, input().split())
w1, w2, w3, w4 = [], [], [], []
w, v = map(int, input().split())
w1.append(v)

# 4パターンしかない
for _ in range(n-1):
    a, b = map(int, input().split())
    if a == w:
        w1.append(b)
    if a == w+1:
        w2.append(b)
    if a == w+2:
        w3.append(b)
    if a == w+3:
        w4.append(b)
        
# 降順にする
for w_ in [w1, w2, w3, w4]:
    w_.sort(reverse= True)
    
ans = 0
for i in range(0, len(w1)+1):
    for j in range(0, len(w2)+1):
        for k in range(0, len(w3)+1):
            # w4を詰める前にチェック
            res = W - (i * w + j * (w+1) + k * (w+2))
            if res < 0:
                continue
            # w4は詰めれるだけ詰める
            tmp = sum(w1[:i])+sum(w2[:j])+sum(w3[:k])+sum(w4[:res//(w+3)])
            ans = max(tmp, ans)
            
print(ans)
n,m=map(int,input().split())
use=[0]
ans=1
for i in range(m):
    use.append(int(input()))
use.append(n)

if n>=2:        
    lists=[1,2]

    for i in range(n-2):
        lists.append((lists[-1]+lists[-2])%1000000007)

    
    for i in range(m+1):
    
        if use[i+1]-use[i]==1 and i>=1:
            ans=0
            break
        else:
            ans=(ans*lists[int(use[i+1]-use[i]-2)])%1000000007
            
            
    print(ans)
elif n==1:
    print(1)


### FIXED CODE ###

n=int(input())
s=list(map(int,input().split()))

changed=sorted(s,reverse=True)


if changed[int(n/2-1)]==changed[int(n/2)]:
        print(0)
else:
        print(-changed[int(n/2)]+changed[int(n/2-1)])
n = int(input())
a = int(input())
b = int(input())
print((b - a) * (n - 2) + 1)

### FIXED CODE ###

n,anb,b=map(int,input().split()) 
if n>1 and b>=anb or n==1 and anb==b: 
    print ((n-2)*(b-anb)+1); 
else:
    print ("0");
import sys
sys.setrecursionlimit(10**9)
dp=[-1]*(10**9+2)
def frog(arr,N):
    if N==0:
        dp[0]=arr[0]
        return dp[0]
    elif N==1:
        dp[1]=abs(arr[1]-arr[0])
        return dp[1]
    elif N==2:
        dp[2]=min(frog(arr,N-1)+abs(arr[N]-arr[N-1]),abs(arr[N]-arr[N-2]))
        return dp[2]
    else:
        if dp[N]!=-1:
            return dp[N]
        dp[N]=min(frog(arr,N-2)+abs(arr[N]-arr[N-2]),frog(arr,N-1)+abs(arr[N]-arr[N-1]))
        return dp[N]
if __name__ == "__main__":
    N=int(input())
    h=[int(i) for i in input().split()][:N]
    print(frog(h,N-1))

### FIXED CODE ###

N=int(input())
h=[int(i) for i in input().split()][:N]
dp=[float('inf')]*N
dp[0]=0
for i in range(N-1):
    if i+1<N:
        dp[i+1]=min(dp[i+1],dp[i]+abs(h[i+1]-h[i]))
    if i+2<N:
        dp[i+2]=min(dp[i+2],dp[i]+abs(h[i+2]-h[i]))
print(dp[-1])
n = input()
print("Yes" if ["111", "222", "333", "444", "555", "666", "777", "888", "999", "000"] in n else "No") 

### FIXED CODE ###

a, b, c, d, = input()
print("Yes" if a==b==c or b==c==d else "No")
n = int(raw_input())
r = []
for i in xrange(1,n+1):
	rest,score = raw_input().split()
	score=int(score)
	r.append((rest,score,i))
r = sorted(r,key=lambda x:(x[0], -x[1], x[2]))
for x in r:
	print x[2]cd 

### FIXED CODE ###

n = int(raw_input())
r = []
for i in xrange(1,n+1):
	rest,score = raw_input().split()
	score=int(score)
	r.append((rest,score,i))
r = sorted(r,key=lambda x:(x[0], -x[1], x[2]))
for x in r:
	print x[2]
while True:
    m, f, r = [int(i) for i in input().split()]

    if m == f ==r -1:
        break

    total = m + f
    if m == -1 or f == -1 or total < 30:
        print('F')

    elif total < 50 and r < 50:
        print('D')

    elif total < 65:
        print('C')
        
    elif total < 80:
        print('B')
    else:
        print('A')
        

### FIXED CODE ###

while True:
    m, f, r = [int(i) for i in input().split()]

    if m == f == r == -1:
        break

    total = m + f
    if m == -1 or f == -1 or total < 30:
        print('F')

    elif total < 50 and r < 50:
        print('D')

    elif total < 65:
        print('C')
        
    elif total < 80:
        print('B')

    else:
        print('A')
a,b = map(int,raw_input().split()) #???????¬?

print a*b , 2*(a+b)

### FIXED CODE ###

a,b=map(int,raw_input().split()) #korenazo
print a*b , 2*(a+b)
R,G,B,M = map(int,input().split())
cnt = 0
for r in range(3001):
  for g in range(3001):
    V = r * R + g * G 
    if N > V and (N - V) % == 0
        cnt += 1
    else:
        continue
print(cnt)

### FIXED CODE ###

R,G,B,N = map(int,input().split())
cnt = 0
for r in range((N // R) + 1):
    for g in range((N - (r * R)) // G + 1):
        V = N - (r * R + g * G)
        if V >= 0 and V % B == 0:
            cnt += 1
print(cnt)
n,k=map(int,input().split())
h=list(int(input()) for _ in range(n))
a=[]
h.sort(reverse=True)
for i in range(n-k+1):
    a.append(h[i]-h[i+k-1])
    if 0 in a:
        print(0)
        exit()
print(min(a))

### FIXED CODE ###

D = int(input())
if D == 25:
    print('Christmas')
elif D == 24:
    print('Christmas Eve')
elif D == 23:
    print('Christmas Eve Eve')
else :
    print('Christmas Eve Eve Eve')
def prim(cost):
    sumcost = 0
    V = len(cost)
    mincost = [float('inf')] * V
    used = [False] * V
    mincost[0] = 0
    while True:
        v = -1
        for u in range(V):
            if not used[u] and (v == -1 or mincost[u] < mincost[ju):
                v = u
        if v == -1: break
        used[v] = True
        sumcost = sumcost + mincost[v]
        for u in range(V):
            if cost[u][v] == -1:
                continue
            mincost[u] = min(mincost[u], cost[v][u])
    return sumcost

### FIXED CODE ###

def prim(cost):
    sumcost = 0
    V = len(cost)
    mincost = [float('inf')] * V
    used = [False] * V
    mincost[0] = 0
    while True:
        j = -1
        for i in range(V):
            if not used[i] and (j == -1 or mincost[i] < mincost[j]):
                j = i
        if j == -1:
            break
        used[j] = True
        sumcost = sumcost + mincost[j]
        for i in range(V):
            if cost[i][j] == -1:
                continue
            mincost[i] = min(mincost[i], cost[j][i])
    return sumcost
 
n = int(raw_input())
A = [0] * n
for i in range(n):
    A[i] = map(int, raw_input().split())
 
result = prim(A)
print(result)
import sys
inputs = sys.stdin.readlines()

M, D = map(int, inputs[0].split())

good_dates = []
for date in range(D):
	d10 = (date+1) // 10
    d1 = (date+1) % 10
    if d1 >= 2 and d10 >= 2:
        if d1*d10 <= M:
            good_dates.append((d1*d10, date))
print(len(good_dates))

d10 = (date+1) // 10
    d1 = (date+1) % 10

### FIXED CODE ###

import sys
inputs = sys.stdin.readlines()

M, D = map(int, inputs[0].split())

good_dates = []
for date in range(D):
    d10 = (date+1) // 10
    d1 = (date+1) % 10
    if d1 >= 2 and d10 >= 2:
        if d1*d10 <= M:
            good_dates.append((d1*d10, date))
print(len(good_dates))
n=int(input())
a=list(map(int, input().split()))
col=[0]*9
for i in range(n):
    col[a[i]//400]+=1
zero=0
cnt=0
for c in range(len(col)-1):
    if col[c]==0:
        zero+=1
    else:
        cnt+=1
m=max(cnt,1)
M=cnt+min(zero,col[-1])
print(m,M)

### FIXED CODE ###

n=int(input())
a=list(map(int, input().split()))
col=[0]*9
for i in range(n):
    j=min(8, a[i]//400)
    col[j]+=1
zero=0
cnt=0
for c in range(len(col)-1):
    if col[c]==0:
        zero+=1
    else:
        cnt+=1
m=max(cnt,1)
M=cnt+col[-1]
print(m,M)
K, A, B = map(int, raw_input().split())
bisco = 1
diff = B - A

if not(A+1 < B):
	print(1+K)

else:
	while K >= 1:
		if(bisco >= A and K >= 2):
			bisco += diff
			K -= 2
		else:
			bisco += 1
			K -= 1
	print(bisco)

### FIXED CODE ###

l = map(int, raw_input().split())

if (l[0] >= (2 * l[1]) -1) :
	print("YES")

else :
	print("NO")
N,K=list(map(int,input().split()))
dp_list=[10**10]*N
h=list(map(int,input().split()))
for _ in range(K):h.append(0)
dp_list[0]=0
for i in range(N):
    for j in range(1,K+1):
        k=i+j
        dp_list[k]=min(dp_list[k],abs(h[k]-h[i])+dp_list[i])
print(dp_list[N-1])

### FIXED CODE ###

import numpy as np
N,K=list(map(int,input().split()))
dp_list=np.full(N,10**10,dtype=int)
h=list(map(int,input().split()))
h=np.array(h)
dp_list[0]=0
for i in range(1,N):
        dp_list[i:i+K] = np.fmin(dp_list[i:i+K], dp_list[i-1] + np.abs(h[i:i+K] - h[i-1]))
print(dp_list[-1])
a, b= list(map(int,input().split()))
print(2*b-a)

### FIXED CODE ###

a= int(input())
b= int(input())
print(2*b-a)
n = int(input())

s = 0
for r in range(1, int((n-1)**0.5)+5):
    if n % r == 0:
        m = n//r-1
        if n//m == n%m:
            s += m
print(s)


### FIXED CODE ###

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

print(n-k+1)
from collections import defaultdict
n = int(input())

abc = []
edges = defaultdict(lambda: [])
for _ in range(n-1):
    a, b, c = map(int, input().split())
    edges[a].append([b, c])
    edges[b].append([a, c])

q, k = map(int, input().split())

# k からの距離を求める
dist = [-1 for _ in range(n+1)]
is_checked = [False for _ in range(n+1)]
def dfs(num, cur_dist):
    for next_num, d in edges[num]:
        if not is_checked[next_num]:
            is_checked[next_num] = True
            dist[next_num] = cur_dist+d
            dfs(next_num, cur_dist+d)
dist[k] = 0
is_checked[k] = True
dfs(k, 0)
# print(dist)
ans = []
for _ in range(q):
    x, y = map(int, input().split())
    ans.append(str(dist[x] + dist[y]))
print("\n".join(ans))

### FIXED CODE ###

import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(20000000)
from collections import defaultdict
n = int(input())

abc = []
edges = defaultdict(lambda: [])
for _ in range(n-1):
    a, b, c = map(int, input().split())
    edges[a].append([b, c])
    edges[b].append([a, c])

q, k = map(int, input().split())

# k からの距離を求める
dist = [-1 for _ in range(n+1)]
is_checked = [False for _ in range(n+1)]
def dfs(num, cur_dist):
    global dist, is_checked
    for next_num, d in edges[num]:
        if not is_checked[next_num]:
            is_checked[next_num] = True
            dist[next_num] = cur_dist + d
            dfs(next_num, cur_dist + d)
dist[k] = 0
is_checked[k] = True
dfs(k, 0)

ans = []
for _ in range(q):
    x, y = map(int, input().split())
    ans.append(str(dist[x] + dist[y]))
print("\n".join(ans))
input()
S=input()
k=int(input())
for s in S:print(s if s == S[k-1] else '*',end='')


### FIXED CODE ###

a,b,c=map(int,input().split())
print('Yes' if a<c<b or a>c>b else 'No')
import collections
N=int(input())
A=list(map(int,input().split()))
li=list(collections.Counter(A).values())
for i in range(N):
  if li[i]<1:
    print('NO')
    exit()
print('YES')

### FIXED CODE ###

import collections
N=int(input())
A=list(map(int,input().split()))
li=list(collections.Counter(A).values())
for i in range(len(li)):
  if li[i]>1:
    print('NO')
    exit()
print('YES')
#atcoder template
def main():
    import sys
    imput = sys.stdin.readline
    if sys.argv[-1] == 'ONLINE_JUDGE':
    import numba
    from numba.pycc import CC
    i8 = numba.int64
    cc = CC('my_module')
 
    def cc_export(f, signature):
        cc.export(f.__name__, signature)(f)
        return numba.njit(f)
 
    fact_table = cc_export(fact_table, (i8, i8))
    main = cc_export(main, (i8, i8, i8))
    cc.compile()

    #文字列入力の時は上記はerrorとなる。
    #ここにコード
    #input
    n, m = map(int, input().split())

    #output
    mod = pow(10, 9) + 7

    n_ = 5 * pow(10, 5) + 5
    fun = [1] * (n_+1)
    for i in range(1, n_+1):
        fun[i] = fun[i-1] * i % mod
    rev = [1] * (n_+1)
    rev[n_] = pow(fun[n_], mod-2, mod)
    for i in range(n_-1, 0, -1):
        rev[i] = rev[i+1] * (i+1) % mod
    def cmb(n,r):
        if n < 0 or r < 0 or r > n: return 0
        return fun[n] * rev[r] % mod * rev[n-r] % mod
    def perm(n, r):
        if n < 0 or r < 0 or r > n: return 0
        return fun[n] * rev[n-r] % mod

    #Aを1, 2, ..., nとする。
    #求める写像の総数をs(n, m)とする。
    #s(n, m) = sum(k=0, n)(cmb(n, k)* (-1)^k * cmb(m-k, n-k)*(n-k)!)

    import math
    answer = 0
    for i in range(n+1):
        temp = perm(n, i) * cmb(m, i) * pow(perm(m-i, n-i), 2)
        temp %= mod
        if i % 2 == 0:
            answer += temp
        else:
            answer -= temp
    print(answer % mod)

    #N = 1のときなどcorner caseを確認！
if __name__ == "__main__":
    main()


### FIXED CODE ###

#atcoder template
def main():
    import sys
    imput = sys.stdin.readline
    #文字列入力の時は上記はerrorとなる。
    #ここにコード
    #input
    n, m = map(int, input().split())

    #output
    mod = pow(10, 9) + 7

    n_ = 5 * pow(10, 5) + 5
    fun = [1] * (n_+1)
    for i in range(1, n_+1):
        fun[i] = fun[i-1] * i % mod
    rev = [1] * (n_+1)
    rev[n_] = pow(fun[n_], mod-2, mod)
    for i in range(n_-1, 0, -1):
        rev[i] = rev[i+1] * (i+1) % mod
    def cmb(n,r):
        if n < 0 or r < 0 or r > n: return 0
        return fun[n] * rev[r] % mod * rev[n-r] % mod
    def perm(n, r):
        if n < 0 or r < 0 or r > n: return 0
        return fun[n] * rev[n-r] % mod

    #Aを1, 2, ..., nとする。
    #求める写像の総数をs(n, m)とする。
    #s(n, m) = sum(k=0, n)(cmb(n, k)* (-1)^k * cmb(m-k, n-k)*(n-k)!)

    import math
    answer = 0
    for i in range(n+1):
        temp = perm(n, i) * cmb(m, i) * pow(perm(m-i, n-i), 2)
        temp %= mod
        if i % 2 == 0:
            answer += temp
        else:
            answer -= temp
    print(answer % mod)

    #N = 1のときなどcorner caseを確認！
if __name__ == "__main__":
    main()
n = int(input())
h = [int(n) for n in input().split()]

a = 0
b = 1
ans = 1

for i in range(n.length-2):
    if n[a]<n[b]:
        ans += 1
    a += 1
    b += 1
print(ans)

### FIXED CODE ###

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

goukei = 0
for i in range(2):
    if A>=B:
        goukei = goukei + A
        A = A - 1
        continue
    
    if B > A :
        goukei = goukei + B
        B = B - 1
        continue
        
print(goukei)
from collections import deque
n = int(input())
cou = n
l_h = []
for i in range(n):
  x,l  = map(int,input().split())
  l_h.append([x-l,x+l])
l_h.sort(key=lambda x: x[1])
d = deque(l_h)
t= d.popleft()
a,b = t[0],t[1]
for i in range(n-1):
  m= d.popleft()
  c,e= m[0],m[1]
  if b<=c:
    b = d
  else:
    cou -= 1
print(cou)

### FIXED CODE ###

from collections import deque
n = int(input())
cou = n
l_h = []
for i in range(n):
  x,l  = map(int,input().split())
  l_h.append([x-l,x+l])
l_h.sort(key=lambda x: x[1])
d = deque(l_h)
t= d.popleft()
a,b = t[0],t[1]
for i in range(n-1):
  m= d.popleft()
  c,e= m[0],m[1]
  if b<=c:
    b = e
  else:
    cou -= 1
print(cou)
# -*- coding: utf-8 -*-


def qui(l):
    num = len(l)
    if num <= 1:
        return l
    piv = 0
    piv2 = len(l)-1
    piv3 = int(len(l)/2)
    if (l[piv] > l[piv2]) and (l[piv2] > l[piv3]):
        piv = piv2
    elif (l[piv] > l[piv3]) and (l[piv3] > l[piv2]):
        piv = piv3
    elif (l[piv] < l[piv2]) and (l[piv2] < l[piv3]):
        piv = piv2
    elif (l[piv] < l[piv3]) and (l[piv3] < l[piv2]):
        piv = piv3
    else:
        pass
    mini = []
    maxi = []

    for i in range(0,len(l)):
        if i == piv:
            continue
        if l[piv] > l[i]:
            mini.append(l[i])
        elif l[piv] <= l[i]:
            maxi.append(l[i])
    return qui(mini) + [l[piv]] + qui(maxi)

input()
list1 = input().split(" ")
for i in range(0, len(list1)):
    list1[i] = int(list1[i])

result = qui(list1)

### FIXED CODE ###

# -*- coding: utf-8 -*-

import random
def qui(l):
    num = len(l)
    if num <= 1:
        return l
    piv = random.randrange(0,len(l))
    piv2 = random.randrange(0,len(l))
    piv3 = random.randrange(0,len(l))
    if (l[piv] > l[piv2]) and (l[piv2] > l[piv3]):
        piv = piv2
    elif (l[piv] > l[piv3]) and (l[piv3] > l[piv2]):
        piv = piv3
    elif (l[piv] < l[piv2]) and (l[piv2] < l[piv3]):
        piv = piv2
    elif (l[piv] < l[piv3]) and (l[piv3] < l[piv2]):
        piv = piv3
    else:
        pass
    mini = []
    middlei = []
    maxi = []

    for i in range(0,len(l)):
        if l[i] == l[piv]:
            middlei.append(l[i])
        elif l[piv] > l[i]:
            mini.append(l[i])
        elif l[piv] <= l[i]:
            maxi.append(l[i])
    mini = qui(mini)
    maxi = qui(maxi)
    return mini+ middlei+maxi
input()
list1 = input().split(" ")
for i in range(0, len(list1)):
    list1[i] = int(list1[i])

result = qui(list1)

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