#include<bits/stdc++.h>

#define ll long long
#define fornum(A,B,C) for(A=B;A<C;++A)
#define pii pair<int,int>
#define pll pair<ll,ll>

using namespace std;

/////////////////////////////////////////////////////
#define MOD (ll)(998244353)
#define MD2 ((MOD+1)/2)

enum SegType{SUM,MIN,MAX};
template<typename T>
struct SegTree{
    int num=0, bt;
    vector<T> node, lazy;
    function<T(const T &,const T &)> calc1;
    function<T(const int &, const int &, const int &, const int &, const T &)> calc2;
    function<T(const T &)> calc3;
    T _init;
    
    void init(int num,T n,SegType st){
        int i = 0, j = 1;
        this->num = num;
        if(st==SegType::MAX){
            if(std::is_same<T,int>().value)
                _init = (T)INT_MIN;
            else if(std::is_same<T,long long>().value)
                _init = (T)LLONG_MIN;
            else
                _init = (T)n;
            this->calc1 = [](const T &a, const T &b) { return max(a, b); };
            this->calc2 = [](const int &x, const int &y, const int &l, const int &r, const T &n) { return n; };
            this->calc3 = [](const T &n) { return n; };
        }else if(st==SegType::MIN){
            if(std::is_same<T,int>().value)
                _init = (T)INT_MAX;
            else if(std::is_same<T, long long>().value)
                _init = (T)LLONG_MAX;
            else
                _init = (T)n;
            this->calc1 = [](const T &a, const T &b) { return min(a, b); };
            this->calc2 = [](const int &x, const int &y, const int &l, const int &r, const T &n) { return n; };
            this->calc3 = [](const T &n) { return n; };
        }else if(st==SegType::SUM){
            if(std::is_same<T,int>().value)
                _init = (T)0;
            else if(std::is_same<T,long long>().value)
                _init = (T)0;
            else
                _init = (T)n;
            this->calc1 = [](const T &a, const T &b) { return (a + b) % MOD; };
            this->calc2 = [](const int &x, const int &y, const int &l, const int &r, const T &n) { return (r - l + 1) * n % MOD; };
            this->calc3 = [](const T &n) { return n * MD2 % MOD; };
        }

        for (j = 1; j < num;)
            j *= 2;
        this->bt = j - 1;
        node.resize(j * 2 - 1, n);
        lazy.resize(j * 2 - 1, 0);
    }
    void addd(int x,int y,T n){
        if(x>y)
            return;
        _addd(x, y, n, 0, 0, this->bt);
    }
    void _addd(const int& x,const int& y,const T& n,int p,int l,int r){
        if (r < x || y < l)
            return;
        if(x<=l&&r<=y){
            lazy[p] += calc2(x, y, l, r, n);
            lazy[p] %= MOD;
            evall(p);
        }else{
            if(lazy[p]!=0)
                evall(p);
            _addd(x, y, n, p * 2 + 1, l, (l + r) / 2);
            _addd(x, y, n, p * 2 + 2, (l + r) / 2 + 1, r);
            node[p] = calc1(node[p * 2 + 1], node[p * 2 + 2]);
        }
    }
    inline void evall(int x){
        node[x] += lazy[x];
        node[x] %= MOD;
        if(x<bt){
            lazy[x * 2 + 1] += calc3(lazy[x]);
            lazy[x * 2 + 1] %= MOD;
            lazy[x * 2 + 2] += calc3(lazy[x]);
            lazy[x * 2 + 2] %= MOD;
        }
        lazy[x] = 0;
    }
    void sett(int x,T n){
        int i = bt+x;
        node[i] = n%MOD;
        while(i!=0){
            i = (i - 1) / 2;
            node[i] = calc1(node[i * 2 + 1],node[i * 2 + 2]);
        }
    }
    inline T gett(int x){
        T ret=_init;
        _gett(x, x, 0, 0, this->bt, ret);
        return ret;
    }
    T gett(int x,int y){
        T ret=_init;
        if(x>y)
            return ret;
        _gett(x, y, 0, 0, this->bt, ret);
        return ret;
    }
    void _gett(const int& x,const int& y,int p,int l,int r,T& ret){
        if(r<x||y<l)
            return;
        if(lazy[p]!=0)
            evall(p);
        if(x<=l&&r<=y){
            ret = calc1(ret, node[p]);
            return;
        }
        _gett(x, y, p * 2 + 1, l, (l + r) / 2, ret);
        _gett(x, y, p * 2 + 2, (l + r) / 2 + 1, r, ret);
    }
};


template<typename T>
struct SegTree2{
    int num=0, bt;
    vector<T> node, lazy;
    function<T(const T &,const T &)> calc1;
    function<T(const int &, const int &, const int &, const int &, const T &)> calc2;
    function<T(const T &)> calc3;
    T _init;
    
    void init(int num,T n,SegType st){
        int i = 0, j = 1;
        this->num = num;
        if(st==SegType::MAX){
            if(std::is_same<T,int>().value)
                _init = (T)INT_MIN;
            else if(std::is_same<T,long long>().value)
                _init = (T)LLONG_MIN;
            else
                _init = (T)n;
            this->calc1 = [](const T &a, const T &b) { return max(a, b); };
            this->calc2 = [](const int &x, const int &y, const int &l, const int &r, const T &n) { return n; };
            this->calc3 = [](const T &n) { return n; };
        }else if(st==SegType::MIN){
            if(std::is_same<T,int>().value)
                _init = (T)INT_MAX;
            else if(std::is_same<T, long long>().value)
                _init = (T)LLONG_MAX;
            else
                _init = (T)n;
            this->calc1 = [](const T &a, const T &b) { return min(a, b); };
            this->calc2 = [](const int &x, const int &y, const int &l, const int &r, const T &n) { return n; };
            this->calc3 = [](const T &n) { return n; };
        }else if(st==SegType::SUM){
            if(std::is_same<T,int>().value)
                _init = (T)0;
            else if(std::is_same<T,long long>().value)
                _init = (T)0;
            else
                _init = (T)n;
            this->calc1 = [](const T &a,const T &b) { return a + b; };
            this->calc2 = [](const int &x, const int &y, const int &l, const int &r, const T &n) { return (r - l + 1) * n; };
            this->calc3 = [](const T &n) { return n / 2; };
        }

        for (j = 1; j < num;)
            j *= 2;
        this->bt = j - 1;
        node.resize(j * 2 - 1, n);
        lazy.resize(j * 2 - 1, 0);
    }
    void addd(int x,int y,T n){
        if(x>y)
            return;
        _addd(x, y, n, 0, 0, this->bt);
    }
    void _addd(const int& x,const int& y,const T& n,int p,int l,int r){
        if (r < x || y < l)
            return;
        if(x<=l&&r<=y){
            lazy[p] += calc2(x, y, l, r, n);
            evall(p);
        }else{
            if(lazy[p]!=0)
                evall(p);
            _addd(x, y, n, p * 2 + 1, l, (l + r) / 2);
            _addd(x, y, n, p * 2 + 2, (l + r) / 2 + 1, r);
            node[p] = calc1(node[p * 2 + 1], node[p * 2 + 2]);
        }
    }
    inline void evall(int x){
        node[x] += lazy[x];
        if(x<bt){
            lazy[x * 2 + 1] += calc3(lazy[x]);
            lazy[x * 2 + 2] += calc3(lazy[x]);
        }
        lazy[x] = 0;
    }
    void sett(int x,T n){
        int i = bt+x;
        node[i] = n;
        while(i!=0){
            i = (i - 1) / 2;
            node[i] = calc1(node[i * 2 + 1],node[i * 2 + 2]);
        }
    }
    inline T gett(int x){
        T ret=_init;
        _gett(x, x, 0, 0, this->bt, ret);
        return ret;
    }
    T gett(int x,int y){
        T ret=_init;
        if(x>y)
            return ret;
        _gett(x, y, 0, 0, this->bt, ret);
        return ret;
    }
    void _gett(const int& x,const int& y,int p,int l,int r,T& ret){
        //printf("%d,%d,%d,%d\n", x, y, l, r);
        if(r<x||y<l)
            return;
        if(lazy[p]!=0)
            evall(p);
        if(x<=l&&r<=y){
            ret = calc1(ret, node[p]);
            //printf("%d,%d,%d,%d:%lld\n", x, y, l, r, ret);
            return;
        }
        _gett(x, y, p * 2 + 1, l, (l + r) / 2, ret);
        _gett(x, y, p * 2 + 2, (l + r) / 2 + 1, r, ret);
    }
};




ll N;
pll Xd[202020];
set<pll> rbs;
ll mk[202020];
ll i, j, k;
int main(){
    scanf("%lld", &N);
    SegTree<ll> sg;
    SegTree2<ll> sg2;
    sg.init(N + 1,0,SegType::SUM);
    sg2.init(N + 1, 0, SegType::MAX);
    fornum(i,0,N){
        ll x, d;
        scanf("%lld%lld", &x, &d);
        Xd[i] = {x, x + d};
    }
    
    sort(Xd, Xd + N);
    rbs.insert({1e18, N});
    sg.sett(N, 1);
    sg2.sett(N, N);
    mk[N] = N;
    j = N - 1;
    for (i = N - 1; i >= 0;--i)
    {
        sg2.sett(i, i);
        pll a = make_pair(Xd[i].second, 0ll);
        rbs.insert({Xd[i].first, i});
        auto it = rbs.lower_bound(a);
        --it;
        ll b = sg2.gett(i, it->second);
        //printf("%lld:%lld\n", i, it->second);

        sg.sett(i, sg.gett(b + 1, N));
        sg2.sett(i, b);
        
    }
    printf("%lld", sg.gett(0, N));
    return 0;
}

Measured memory_bytes: 32256