const rl = require("readline").createInterface({ input: process.stdin });
var iter = rl[Symbol.asyncIterator]();
const readline = async () => (await iter.next()).value;
void (async function () {
const n = Number(await readline());
const lives = [];
for (let i = 0; i < n; i++) {
const [t, l] = (await readline()).split(" ").map(Number);
lives.push([t, l + t]);
}
lives.sort((a, b) => {
if (a[0] === b[0]) return a[1] - b[1];
return a[0] - b[0];
});
const dp = new Array(n).fill(1);
for (let i = 1; i < n; i++) {
for (let j = 0; j < i; j++) {
if (lives[j][1] + 15 <= lives[i][0]) {
dp[i] = Math.max(dp[i], dp[j] + 1);
}
}
}
console.log(dp[n - 1]);
})();