CodeEff/ECCO huggingface dataset:
# Original solution
n = int(eval(input()))
robot = []
for _ in range(n):
    x, l = list(map(int, input().split()))
    arm_left = x - l
    arm_right = x + l
    robot.append([arm_left, arm_right])

robot.sort(key=lambda x: x[1])
count = 0
while True:
    if len(robot) == 0:
        break
    count += 1
    current_right = robot[0][1]
    robot = [i for i in robot if i[0] >= current_right]

print(count)

# Optimized solution
n = int(eval(input()))
robot = []
for _ in range(n):
    x, l = list(map(int, input().split()))
    arm_left = x - l
    arm_right = x + l
    robot.append([arm_left, arm_right])

robot.sort(key=lambda x: x[1])
count = 0
current_right = -1000000000
for i in range(n):
    if robot[i][0] >= current_right:
        count += 1
        current_right = robot[i][1]

print(count)
# Original solution
N = int(eval(input()))
s = [tuple(map(int, input().split())) for i in range(N)]

s.sort(key=lambda x: x[1])

t = list([(j[0]-j[1]+1, j[0]+j[1]-1) for j in s])
NN = len(t)
dobon = []

for k in range(NN):
  for l in range(k+1, NN):
    if l not in dobon:
      if int(t[k][1]) <= int(t[l][1]):
        if (t[l][0] <= t[k][1]) and (t[k][1] <= t[l][1]):
          N -= 1
          dobon.append(l)
          break
      else:
        if (t[l][0] <= t[k][0]) and (t[k][0] <= t[l][1]):
          N -= 1
          dobon.append(l)
          break

print(N)

# Optimized solution
N = int(eval(input()))
S = [tuple(map(int, input().split())) for i in range(N)]
T = list([(j[0]-j[1], j[0]+j[1]) for j in S])

T.sort(key=lambda x: x[1])

for i, t in enumerate(T):
  if i>0:
    if end <= t[0]:
      res += 1
      start = t[0]
      end = t[1]
  else:
    start = t[0]
    end = t[1]
    res = 1

print(res)
# Original solution
n = int(eval(input()))
robot = []
for _ in range(n):
    x, l = list(map(int, input().split()))
    robot.append([x - l, x + l])

# startが被らないendが小さいもの

ans = 0
robot.sort(key=lambda x: x[1])
last = - float('inf')
for start, end in robot:
    if start >= last:
        ans += 1
        last = end

print(ans)


# Optimized solution
import sys
input = sys.stdin.readline

n = int(eval(input()))
robot = []
for _ in range(n):
    x, l = list(map(int, input().split()))
    robot.append([x - l, x + l])

# startが被らないendが小さいもの

ans = 0
robot.sort(key=lambda x: x[1])
last = - float('inf')
for start, end in robot:
    if start >= last:
        ans += 1
        last = end

print(ans)
# Original solution
N = int(eval(input()))
XL = [tuple(map(int,input().split())) for i in range(N)]
XL.sort(key=lambda x: x[0]+x[1])
right = -float('inf')
ans = 0
for x,l in XL:
    s,t = x-l, x+l
    if s >= right:
        right = t
        ans += 1
print(ans)


# Optimized solution
N = int(eval(input()))
table = []
for i in range(N):
    X,L = list(map(int,input().split()))
    table.append((X-L,X+L))
table = sorted(table, key=lambda x:x[1])

cur = 0
l_cur, r_cur = table[0]
ans = N
for i in range(1,N):
    l,r = table[i]
    if r_cur > l:
        ans -= 1
    else:
        l_cur, r_cur = l,r
print(ans)
# Original solution
import copy
n = int(eval(input()))
xl = []
for i in range(n):
    xl.append([int(i) for i in input().split()])
    xl[i].append(xl[i][0] - xl[i][1])
    xl[i].append(xl[i][0] + xl[i][1])
xl.sort(key=lambda x: x[3])
ng = []
ans = 0
for i in range(n):
    tmp = list(range(xl[i][2] + 1, xl[i][3]))
    a = copy.deepcopy(tmp) #動く範囲
    a.extend(ng)
    if len(set(a)) == len(a):
        ng.extend(tmp)
        ans += 1
print(ans)


# Optimized solution
n = int(eval(input()))
robot = []
for i in range(n):
    x, l = list(map(int,input().split()))
    robot.append([x + l, x - l]) #left, right
robot.sort()
preright = robot[0][1]
ans = 0
for i in range(n):
    left = robot[i][1]
    #print(preright, left)
    if preright <= left:
        ans += 1
        preright = robot[i][0]
print(ans)
# Original solution
# coding: utf-8
import math
import collections


def main():
    n = int(eval(input()))
    inputs = [input().split() for i in range(n)]
    inputs_list = []
    for tmp in inputs:
        if int(tmp[0]) - int(tmp[1]) < 0:
            for i in range(0, int(tmp[0]) + int(tmp[1])):
                inputs_list.append(i)
        else:
            for i in range(int(tmp[0]) - int(tmp[1]), int(tmp[0]) + int(tmp[1])):
                inputs_list.append(i)

    c = collections.Counter(inputs_list)
    print((n - (c.most_common()[0][1] - 1)))


if __name__ == '__main__':
    main()


# Optimized solution
# coding: utf-8
def main():
    n = int(eval(input()))
    inputs = [input().split() for i in range(n)]
    inputs_list = []
    for i in inputs:
        if int(i[0]) - int(i[1]) < 0:
            inputs_list.append([0, int(i[0]) + int(i[1])])
        else:
            inputs_list.append([int(i[0]) - int(i[1]), int(i[0]) + int(i[1])])
    sorted_data = sorted(inputs_list, key=lambda x: (x[1]))

    ans = [sorted_data[0]]
    cur = ans[0][1]
    for i in range(len(sorted_data) - 1):
        if cur <= sorted_data[i + 1][0]:
                ans.append(sorted_data[i + 1])
                cur = sorted_data[i + 1][1]
    print((len(ans)))


if __name__ == '__main__':
    main()
# Original solution
n = int(eval(input()))
a = []
for _ in range(n):
    c0, c1 = list(map(int, input().split()))
    a.append([c0-c1, c0+c1])
a.sort(key=lambda x: x[1])
ans = 1
b = [a[0]]

for i in a[1:]:
    for j, k in enumerate(b):
        if not (k[1] <= i[0]):
            break
        if j == len(b)-1:
            ans += 1
            b.append(i)
print(ans)


# Optimized solution
n = int(eval(input()))
a = []
for _ in range(n):
    c0, c1 = list(map(int, input().split()))
    a.append([c0-c1, c0+c1])
a.sort(key=lambda x: x[1])
ans, b = 1, a[0][1]
for i in a[1:]:
    if b <= i[0]:
        b = i[1]
        ans += 1
print(ans)
# Original solution
import sys
n = int(eval(input()))
xl = []
for _ in range(n):
    x, l = list(map(int, input().split()))
    xl.append((x, l))
xl.sort(key=lambda x:x[0])
i = 0
if n==1:
    print((1))
    sys.exit(0)
while i<len(xl)-1:
    if xl[i][0]+xl[i][1] <= xl[i+1][0]-xl[i+1][1]:
        i += 1
    else:
        if xl[i][0]+xl[i][1] < xl[i+1][0]+xl[i+1][1]:
            del xl[i+1]
        else:
            del xl[i]
print((len(xl)))

# Optimized solution
import sys
n = int(eval(input()))
xl = []
for _ in range(n):
    x, l = list(map(int, input().split()))
    xl.append((x, l))
xl.sort(key=lambda x:x[0])
if n==1:
    print((1))
    sys.exit(0)
i=0
j=1
ans=n
while j<len(xl):
    if xl[i][0]+xl[i][1] <= xl[j][0]-xl[j][1]:
        i = j
        j = i+1
    else:
        ans -= 1
        if xl[i][0]+xl[i][1] < xl[j][0]+xl[j][1]:
            j += 1
        else:
            i = j
            j = i+1
print(ans)
# Original solution
n=int(eval(input()))
Y=[list(map(int,input().split())) for i in range(n)]
range=[]
ans,end=0,-1*(10**9+1)
for X in Y:
  range.append([X[0]-X[1],X[0]+X[1]])
range.sort(key=lambda X: X[1])

for R in range:
  if end <= R[0]:
    ans += 1
    end=R[1]
  else:
    continue
print(ans)

# Optimized solution
n=int(eval(input()))
Range=[]
ans,end=0,-1*(10**9+1)
for i in range(n):
  x,y=list(map(int,input().split()))
  Range.append([x-y,x+y])
Range.sort(key=lambda X: X[1])

for R in Range:
  if end <= R[0]:
    ans += 1
    end=R[1]
  else:
    continue
print(ans)
# Original solution
def main():
    n = int(eval(input()))
    x = []
    xl = {}
    tmp = []
    tmp2 = []
    maxtmp = 0
    for i in range(n):
        xx, ll = list(map(int,input().split()))
        if maxtmp < xx:
            maxtmp = xx
        low = max(xx-ll+1,0)
        high = xx+ll-1
        lmh = [low,xx,high]
        tmp.append(lmh)
        tmp2.append(lmh)
        x.append(xx)


    tmp.sort()

    # for i in range()
    flg = 0
    for i, a in enumerate(tmp):
        if flg == 0:

            low = a[0]
            high = a[2]
            flg = 1
        else:

            if low <= a[0] and high >= a[0]:
                 aa= tmp2.pop(tmp2.index(a))


        if i+1 < len(tmp) and high < tmp[i+1][0]:
            flg = 0
    print((len(tmp2)))
    return


if __name__=='__main__':
    main()


# Optimized solution
def main():
    n = int(eval(input()))
    x = []
    xl = {}
    tmp = []
    ans = 0
    maxtmp = 0
    for i in range(n):
        xx, ll = list(map(int,input().split()))
        if maxtmp < xx:
            maxtmp = xx
        low = xx-ll
        high = xx+ll
        lmh = [high,xx,low]
        tmp.append(lmh)


    tmp.sort()
    high = tmp[0][0]
    ans = 1
    for i in range(1,len(tmp)):
        a = tmp[i]
        if a[2] >= high:
            high = a[0]
            ans += 1
        else:
            continue

    print(ans)
    return


if __name__=='__main__':
    main()
# Original solution
N = int(eval(input()))
r = [list(map(int, input().split())) for _ in range(N)]
a = []
for i in r:
    a.append((i[0]+i[1],i[0]-i[1]))
a.sort()
ans = 0
cur = -float('inf')
for i in a:
    if i[1] < cur:
        continue
    ans += 1
    cur = i[0]
print(ans)

# Optimized solution
N = int(eval(input()))
r = [list(map(int, input().split())) for _ in range(N)]
a = []
for i in r:
    a.append((i[0]-i[1],i[0]+i[1]))
a.sort(key=lambda x:x[1])
ans = 0
cur = -float('inf')
for i in a:
    if i[0] < cur:
        continue
    ans += 1
    cur = i[1]
print(ans)
# Original solution
n = int(eval(input()))
Robo = []
for i in range(n):
  x, leng = list(map(int, input().split()))
  Robo.append([x - leng + 1, x + leng - 1])
Robo.sort(key=lambda x: x[1])
#print(Robo)

Robo_r = []
for robo_cand in Robo:
  l, r = robo_cand
  for robo_r in Robo_r:
    if l <= robo_r[1]:
      break
  else:
    Robo_r.append(robo_cand)
print((len(Robo_r)))

# Optimized solution
n = int(eval(input()))

Robo = []
for i in range(n):
    x, l = list(map(int, input().split()))
    Robo.append([x-l, x+l])
Robo.sort(key=lambda x: x[1])

#print(Robo)
biggest_right = 2 * -10**9 - 1
counter = 0
for left, right in Robo:
    if biggest_right <= left:
        counter += 1
        biggest_right = max(right, biggest_right)
print(counter)
# Original solution
import sys
from bisect import bisect
from operator import itemgetter

n = int(eval(input()))
robots = []
for line in sys.stdin:
    X, L = list(map(int, line.split()))
    l, r = X - L, X + L
    robots.append((l, r))
robots.sort(key=itemgetter(1))

dp = [-(10 ** 18)]
for l, r in robots:
    i = bisect(dp, l)
    if len(dp) == i:
        dp.append(r)
    else:
        dp[i] = min(dp[i], r)
print((len(dp) - 1))


# Optimized solution
import sys
from operator import itemgetter

n = int(eval(input()))
robots = []
for line in sys.stdin:
    X, L = list(map(int, line.split()))
    l, r = X - L, X + L
    robots.append((l, r))
robots.sort(key=itemgetter(1))

curr = -(10 ** 10)
ans = 0
for l, r in robots:
    if curr > l:
        continue
    ans += 1
    curr = r
print(ans)
# Original solution
N = int(eval(input()))
r = [list(map(int, input().split())) for _ in range(N)]
r.sort()

l = [r[0]]
r = r[1:]
while len(r) > 0:
    x1, l1 = l[-1]
    x2, l2 = r[0]
    if (x1+l1) > (x2-l2):
        if (x1+l1) > (x2+l2):
            l.pop()
            l.append(r[0])
            r.pop(0)
        else:
            r.pop(0)
    else:
        l.append(r[0])
        r.pop(0)
print((len(l)))


# Optimized solution
N = int(eval(input()))
r = [list(map(int, input().split())) for _ in range(N)]
r.sort()

l = r[0]
ri = 1
ans = N
while ri < N:
    x1, l1 = l
    x2, l2 = r[ri]
    if (x1+l1) > (x2-l2):
        if (x1+l1) > (x2+l2):
            l = r[ri]
            ri += 1
        else:
            ri += 1
        ans -= 1
    else:
        l = r[ri]
        ri += 1
print(ans)
# Original solution
n = int(eval(input()))
robo = [0] * n
for i in range(n):
    x, l = list(map(int, input().split()))
    robo[i] = (x - l, x + l)
robo.sort(key=lambda x: x[1])

max_r, cnt = -float('inf'), 0
for l, r in robo:
    if  max_r <= l:
        cnt += 1
        max_r = max(max_r, r)
print(cnt)

# Optimized solution
n = int(eval(input()))
robo = [0] * n
for i in range(n):
    x, l = list(map(int, input().split()))
    robo[i] = (x - l, x + l)
robo.sort(key=lambda x: x[1])

max_r, cnt = -float('inf'), 0
for l, r in robo:
    if  max_r <= l:
        cnt += 1
        max_r = r
print(cnt)
# Original solution
#!python3

iim = lambda: list(map(int, input().rstrip().split()))

from bisect import bisect_left

def resolve():
    N = int(eval(input()))
    #S = [list(iim()) for i in range(N)]
    MX = 10**9
    S = []
    for i in range(N):
        x, l = iim()
        i = x - l
        if i < 0:
            i = 0
        j = x + l
        if j > MX:
            j = MX

        a = [i, j]
        S.append(a)
    S.sort()

    d = dict()
    x, y = S[0]
    d = {-1: 0}
    dk = [-1]
    ans = 0
    for x, y in S:
        for xx in dk:
            if xx <= x:
                n = d[xx] + 1
                if y in d:
                    if d[y] < n:
                        d[y] = n
                        if ans < n:
                            ans = n
                else:
                    d[y] = n
                    dk.append(y)
                    if ans < n:
                        ans = n
        #print(x, y, d)
    print(n)






if __name__ == "__main__":
    resolve()


# Optimized solution
#!python3

iim = lambda: list(map(int, input().rstrip().split()))

from bisect import bisect_left

def resolve():
    N = int(eval(input()))
    #S = [list(iim()) for i in range(N)]
    MX = 10**9
    S = []
    for i in range(N):
        x, l = iim()
        i = x - l
        if i < 0:
            i = 0
        j = x + l
        if j > MX:
            j = MX

        a = [i, j]
        S.append(a)
    S.sort()

    ans = 0
    last = MX+1
    n = 1
    for x, y in S:
        if y < last:
            last = y
        elif last <= x:
            n += 1
            last = y

    print(n)






if __name__ == "__main__":
    resolve()
# Original solution
def main():
    n = int(eval(input()))

    s = []
    e = []
    tls = []
    buff = {}
    for i in range(n):
        tmp = list(map(int, input().split()))
        s.append(tmp[0] - tmp[1])
        e.append(tmp[0] + tmp[1])
    for i in range(n):
        buff[s[i]] = e[i]
    
    maxcount = 0
    sorted_s = sorted(s)
    preve = 0
    while len(sorted_s) > 0:
        tmps = sorted_s[0]
        tmpe = buff[tmps]
        if preve == 0:
            maxcount += 1
            preve = tmpe
            sorted_s = sorted_s[1:]
        elif tmps >= preve:
            maxcount += 1
            preve = tmpe
            sorted_s = sorted_s[1:]
        elif tmpe < preve:
            preve = tmpe
            sorted_s = sorted_s[1:]
        else:
            sorted_s = sorted_s[1:]
    print(maxcount)
    return
if __name__ == "__main__":
    main()

# Optimized solution
def main():
    n = int(eval(input()))
    x = []
    l = []
    for i in range(n):
        tmp = list(map(int, input().split()))
        x.append(tmp[0] - tmp[1])
        l.append(tmp[0] + tmp[1])
    x, l = list(zip(*sorted(zip(x, l))))
    maxcount = 0
    preve = 0
    idx = 0
    while idx < n:
        tmps = x[idx]
        tmpe = l[idx]
        if preve == 0:
            maxcount += 1
            preve = tmpe
        elif tmps >= preve:
            maxcount += 1
            preve = tmpe
        elif tmpe < preve:
            preve = tmpe
        idx += 1
    print(maxcount)
    return

if __name__ == "__main__":
    main()
# Original solution
import itertools
N = int(eval(input()))
alllist = []
remain = 0
for i in range(N):
    X, L = list(map(int,input().split()))
    alllist.append([i for i in range(X-L,X+L)])
d = 0
l = alllist
for i in range(N):
    kumiawase = N-i
    c_list = list(itertools.combinations(l, kumiawase))
    for j in range(len(c_list)):
        first = c_list[j][0]
        c= 1
        for k in range(len(c_list[j])-1):
            if len(set(c_list[j][k+1]) & set(first)) == 0:
                c += 1
            else:
                break
        if c == kumiawase:
            print(kumiawase)
            d = 1
            break
        else:
            pass
    if d == 1:
        break
    else:
        pass

# Optimized solution
import itertools
N = int(eval(input()))
alllist = []
remain = 0
for i in range(N):
    X, L = list(map(int,input().split()))
    alllist.append([X-L,X+L])
d = 0
l = alllist
for i in range(N):
    kumiawase = N-i
    c_list = list(itertools.combinations(l, kumiawase))
    for j in range(len(c_list)):
        first = [q for q in range(c_list[j][0][0],c_list[j][0][1])]
        c= 1
        for k in range(len(c_list[j])-1):
            if len(set(r for r in range(c_list[j][k+1][0],c_list[j][k+1][1])) & set(first)) == 0:
                c += 1
            else:
                break
        if c == kumiawase:
            print(kumiawase)
            d = 1
            break
        else:
            pass
    if d == 1:
        break
    else:
        pass
# Original solution
# https://atcoder.jp/contests/keyence2020/tasks/keyence2020_b

'''

区間スケジューリング問題：終点でソートして貪欲法

'''


import sys
input = sys.stdin.readline

N = int(eval(input()))
schedule = []
for i in range(N):
    x, l = list(map(int, input().split()))
    schedule.append((x - l, l + x))             # schedule = (始点、終点)

schedule = sorted(schedule, key=lambda x: x[1])
ans = 0
end = -10**12                                   # 始点の最小値

for i in range(N):
    if end <= schedule[i][0]:
        end = schedule[i][1]                    # 終点でソートされているので、自動的に可能な中で最速の終点が選ばれている
        ans += 1

print(ans)

# Optimized solution
def Schedule(schedule):
    """
    :return: 複数の区間が与えられた時の重複の無い区間の選び方の最大数
    """
    schedule = sorted(schedule, key=lambda x: x[1])
    N = len(schedule)
    res = 0
    end = -float("inf")

    for i in range(N):
        if end <= schedule[i][0]:  # 重複がダメならば等号を消す
            end = schedule[i][1]  # 終点でソートされているので、自動的に可能な中で最速の終点が選ばれている
            res += 1
    return res

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

import sys
input = sys.stdin.readline

N = int(eval(input()))
schedule = []
for i in range(N):
    x, l = list(map(int, input().split()))
    schedule.append((x - l, l + x))             # schedule = (始点、終点)

print((Schedule(schedule)))
# Original solution
n = int(eval(input()))
l = [list(map(int,input().split())) for i in range(n)]
left = []



for i in range(n):
    left.append((l[i][0]-l[i][1],l[i][0]+l[i][1]))
left.sort()   
count = 1
right = 10**10
for i in range(n):
    right = min(right,left[i][1])

while True:
    right2 = 10**10
    for i in range(n):
        if left[i][0] >= right:
            
            right2 = min(right2,left[i][1])
            
            
    if right2 == 10**10:
        print(count)
        exit()
    else:
        right = right2
        count += 1


# Optimized solution
n = int(eval(input()))
l = [list(map(int,input().split())) for i in range(n)]
left = []



for i in range(n):
    left.append((l[i][0]+l[i][1],l[i][0]-l[i][1]))
left.sort()   
count = 1
right = 10**10
right = left[0][0]
c = 0

while True:
    
    for i in range(c,n+1):
        if i == n:
            print(count)
            exit()
        if left[i][1] >= right:
            count += 1
            right = left[i][0]
            c = i
            
            
            
    if c == n-1:
        print(count)
        exit()
# Original solution
#!/usr/bin/env python3
INF = float("inf")
n, *d = list(map(int, open(0).read().split()))
p = sorted(zip(*[iter(d)]*2), key=sum)
M, a = -INF, 0
for X, L in p:
    l, r = X-L, X+L
    if M <= l:
        a += 1
        M = r
print(a)

# Optimized solution
M,a =-float("inf"),0
for X,L in sorted(zip(*[iter(map(int,open(0).read().split()[1:]))]*2),key=sum):
 l,r=X-L,X+L
 if M<=l:a+=1;M=r
print(a)
# Original solution
n = int(eval(input()))
a = [list(map(int,input().split())) for i in range(n)]

d = list(range(0))
for i in range(n):
    b = a[i][0] - a[i][1]
    c = a[i][0] + a[i][1]
    d.append([b,c])

def aaa():
  #print(d)
  e = list(range(0))
  mcnt = 0
  f = 0 
  for i in range(len(d)):
    cnt = 0
    #print(i)
    for j in range(len(d)):
      
      if i != j :      
        if (d[i][0] < d[j][0] and d[i][1] > d[j][0]) or (d[i][0] < d[j][1] and d[i][1] > d[j][1]):
          cnt = cnt + 1
          #print(cnt)
    if cnt > 0 and mcnt < cnt:
      mcnt = cnt
      f = i  
  #print(mcnt)
  if mcnt > 0 :
    d.pop(f)
    #print('pop')
  return mcnt
    
x = 1
while x > 0 :
  x = aaa()
  #print(x)


    
print((len(d))) 



 
    
  

         

  




# Optimized solution
n = int(eval(input()))
robots = []
for i in range(n):
    x, l = [int(item) for item in input().split()]
    robots.append((x+l, x-l))
 
robots.sort()
#print(robots)

cnt = 0
node = -float("inf")
for end, start in robots:
    if start >= node:
        node = end
        cnt += 1
print(cnt)
# Original solution
N=int(eval(input()))
xl=[list(map(int,input().split()))for _ in range(N)]
arms={}
for x,l in xl:
    arms[x-l]=0
    arms[x+l]=0
for x,l in xl:
    arms[x-l]+=1
    arms[x+l]-=1
point={}
for x,l in xl:
    point[x-l]=[]
    point[x+l]=[]
for x,l in xl:
    point[x-l].append(x+l)

ans=N
K=sorted(arms.keys())
now=0
count=[]
for k in K:
    now+=arms[k]
    for kk in point[k]:
        count.append(kk)
    for i in range(count.count(k)):
        count.remove(k)
    if now>=2:
        ans-=now-1
        now=1
        C=sorted(count)[::-1]
        for c in C[:-1]:
            arms[c]+=1
            count.remove(c)

print(ans)

# Optimized solution
N=int(eval(input()))
xl=[list(map(int,input().split()))for _ in range(N)]
rl=[[x+l,x-l]for x,l in xl]
rl.sort()
now=-10**9
ans=0
for r,l in rl:
    if l>=now:
        ans+=1
        now=r
print(ans)
# Original solution
N=int(eval(input()))
T=[]
for i in range(N):
    X,L=list(map(int,list(input().split(" "))))
    T.append([X+L,X-L])
T.sort()
sum=1
def check(T,v,w):
    if T[v][0]<=T[w][1] or T[v][1]>=T[w][0]:
        return True
    else:
        return False

checks=[0]
for i in range(1,N):
    count=0
    for  j in checks:
        if not check(T,i,j):
            break
        count+=1
    if count==len(checks):
        sum+=1
        checks.append(i)
print(sum)

# Optimized solution
N=int(eval(input()))
X=[]
for i in range(N):
    a,b=list(map(int,list(input().split(" "))))
    X.append([a+b,a-b])
X.sort()
D={}
D[0]=1
exe=[0]
for i in range(1,N):
    k=X[i][0]
    if X[i][1]<X[exe[-1]][0]:
        D[i]=D[exe[-1]]
    else:
        D[i]=D[exe[-1]]+1
        exe.append(i)
print((len(exe)))
# Original solution
N = int(eval(input()))
move = []
for i in range(N):
    X,L = list(map(int,input().split()))
    move.append([X-L,X+L])
move = sorted(move, key=lambda x:(x[0],x[1]))

if N == 1:
    print((1))
else:    
    i = 1
    while(len(move) > i):
        if move[i-1][0] == move[i][0]:
            del move[i-1]
        else:
            if move[i][1] <= move[i-1][1]:
                del move[i]
            else:
                i += 1
    
    if len(move) <= 2:
        print((len(move)))
    else:
        i = 1
        while(len(move) > i+1):
            if move[i-1][1] >= move[i+1][0]:
                del move[i]
            else:
                i += 1
        print((len(move)))

# Optimized solution
N = int(eval(input()))
K = []
for i in range(N):
    X,L = list(map(int,input().split()))
    K.append([X-L,X+L])

T = sorted(K,key=lambda x:x[1])
a = T[0][1]

c = 1
for i in range(1,N):
    if T[i][0] >= a:
        c += 1
        a = T[i][1]
print(c)