import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Text.Read as T
import Data.List (sortBy, groupBy)
import Data.Tuple (swap)
import Data.Function (on)

main :: IO ()
main = do
  (n : _) <- map unsafeSignedDecimal . T.words <$> T.getLine :: IO [Int]
  xls <- sequence . replicate n $ unsafeListToTuple . map unsafeSignedDecimal . T.words <$> T.getLine :: IO [(Int, Int)]
  let
    lrs :: [(Int, Int)]
    lrs = sortBy (compare `on` snd) . map bound $ xls
    step :: (Int, Int) -> (Int, Int) -> (Int, Int)
    step acc@(s, r0) (l, r) | r0 <= l   = (succ s, r)
                            | otherwise = acc
  print . fst . foldl step (0, -(10 ^ 9)) $ lrs

bound :: (Int, Int) -> (Int, Int)
bound (x, l) = (x - l, x + l)

unsafeListToTuple :: [Int] -> (Int, Int)
unsafeListToTuple (x : y : _) = (x, y)

unsafeSignedDecimal :: T.Text -> Int
unsafeSignedDecimal s = case T.signed T.decimal s of
  Right (n, _) -> n
