local function axiscomp(ary)
  local z = {}
  for i = 1, #ary do
    z[i] = ary[i]
  end
  table.sort(z)
  local ac, acinv = {}, {}
  local cur = 0
  for i = 1, #z do
    if not acinv[z[i]] then
      cur = cur + 1
      ac[cur] = z[i]
      acinv[z[i]] = cur
    end
  end
  return ac, acinv
end

local n = io.read("*n")
local ax = {}
local left, right = {}, {}
local idx = {}
for i = 1, n do
  local a, b = io.read("*n", "*n")
  left[i], right[i] = a - b, a + b
  table.insert(ax, a - b)
  table.insert(ax, a + b)
  idx[i] = i
end
local ac, acinv = axiscomp(ax)

local edge = {}
for i = 1, #ac do
  edge[i] = {}
  if i ~= #ac then
    edge[i][i + 1] = 0
  end
end
for i = 1, n do
  local l, r = acinv[left[i]], acinv[right[i]]
  edge[l][r] = 1
end

local len = {}
for i = 1, #ac do len[i] = -1 end
len[1] = 0
for src = 1, #ac - 1 do
  for dst, cost in pairs(edge[src]) do
    if len[dst] < len[src] + cost then
      len[dst] = len[src] + cost
    end
  end
end

print(len[#ac])
