const
  fin = 'camci.in';
  fout = 'camci.out';
  maxN = 10000;
  inf = 999999999;

type
  TBoat = record
            p, l : Longint;
          end;

var
  n, m : Integer;
  c : array[1..maxN] of TBoat;



procedure ReadInput;
var
  f : Text;
  i : Integer;
begin
  Assign(f, fin);
  Reset(f);
  Readln(f, n);
  for i := 1 to n do
    Readln(f, c[i].l, c[i].p);
  Close(f);
end;


procedure Sort;
var
  tmp : TBoat;

  procedure QuickSort(l, r : Integer);
  var
    i, j : Integer;
    p : Longint;
  begin
    i := l;
    j := r;
    p := c[(l + r) div 2].p;
    repeat
      while c[i].p < p do inc(i);
      while p < c[j].p do dec(j);
      if i <= j then
      begin
        tmp := c[i];
        c[i] := c[j];
        c[j] := tmp;
        inc(i);
        dec(j);
      end;
    until i > j;
    if l < j then QuickSort(l, j);
    if i < r then QuickSort(i, r);
  end;

begin
  QuickSort(1, n);
end;


function Min(a, b : Longint) : Longint;
begin
  if a < b then
    Min := a
  else
    Min := b
end;


function Max(a, b : Longint) : Longint;
begin
  if a > b then
    Max := a
  else
    Max := b
end;


procedure Solve;
var
  i, j, k : Integer;
  s : array[0..MaxN+1] of Longint;
  r : Longint;
begin
  Sort;

  s[0] := -inf;
  s[1] := inf;
  m := 0;

  for i := 1 to n do
  begin
    for j := m+1 downto 1 do
    begin
      if s[j-1] <= c[i].p then
        r := Max(c[i].p, s[j-1] + c[i].l)
      else
        r := inf;

      s[j] := Min(s[j], r);
    end;

    if s[m+1] < inf then
    begin
      inc(m);
      s[m+1] := inf;
    end;
  end;
end;


procedure WriteOutput;
var
  f : Text;
begin
  Assign(f, fout);
  Rewrite(f);
  Writeln(f, m);
  Close(f);
end;




begin
  ReadInput;
  Solve;
  WriteOutput;
end.
