#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
using ll = long long ;
using P = pair<int,int> ;
using pll = pair<long long,long long>;
constexpr int INF = 1e9;
constexpr long long LINF = 1e17;
constexpr int MOD = 998244353;
constexpr double PI = 3.14159265358979323846;

template<int mod> struct ModInt{
    long long x=0; 
    constexpr ModInt(long long x=0):x((x%mod+mod)%mod){}
    constexpr ModInt operator+(const ModInt& r)const{return ModInt(*this)+=r;}
    constexpr ModInt operator-(const ModInt& r)const{return ModInt(*this)-=r;}
    constexpr ModInt operator*(const ModInt& r)const{return ModInt(*this)*=r;}
    constexpr ModInt operator/(const ModInt& r)const{return ModInt(*this)/=r;}
    constexpr ModInt& operator+=(const ModInt& r){ if((x+=r.x)>=mod) x-=mod; return *this;}
    constexpr ModInt& operator-=(const ModInt& r){ if((x-=r.x)<0) x+=mod; return *this;}
    constexpr ModInt& operator*=(const ModInt& r){ if((x*=r.x)>=mod) x%=mod; return *this;}
    constexpr ModInt& operator/=(const ModInt& r){ return *this*=r.inv();}
    ModInt inv() const {
        long long s=x,sx=1,sy=0,t=mod,tx=0,ty=1;
        while(s%t!=0){
            long long temp=s/t,u=s-t*temp,ux=sx-temp*tx,uy=sy-temp*ty;
            s=t;sx=tx;sy=ty;
            t=u;tx=ux;ty=uy;
        }
        return ModInt(tx);
    }
    ModInt pow(long long n) const {
        ModInt a=1;
        while(n>0){
            if(n&1) a*=*this;
            *this*=*this;
            n>>=1;
        }
        return a;
    }
    friend constexpr ostream& operator<<(ostream& os,const ModInt<mod>& a) {return os << a.x;}
    friend constexpr istream& operator>>(istream& is,ModInt<mod>& a) {return is >> a.x;}
};
using mint = ModInt<MOD>;

struct Segmenttree{
    int n;
    vector<long long> node;

    Segmenttree(vector<long long> v){
        n = (int)(v.size());
        node.resize(2*n);
        for(int i=0;i<n;i++) node[i+n] = v[i];
        for(int i=n-1;i>=0;i--) node[i] = max(node[i<<1],node[i<<1|1]);
    }
    //i番目の要素をxに変更する
    void update(int i,long long x){
        i += n;
        node[i] = x;
        while(i>1){
            i >>= 1;
            node[i] = max(node[i<<1],node[i<<1|1]);
        }
    }
    //[l,r)の要素のmaxを求める
    long long query(int l,int r){
        long long res = 0;
        l += n; r += n;
        while(l<r){
            if(l&1) res = max(res,node[l++]);
            if(r&1) res = max(res,node[--r]);
            l >>= 1; r >>= 1;
        }
        return res;
    }
    //i番目の要素にアクセス
    long long getval(int i){
        return node[i+n];
    }
};

int main(){
    int n;
    cin >> n;
    vector<P> xd(n);
    rep(i,n) cin >> xd[i].first >> xd[i].second;
    sort(xd.begin(),xd.end());
    Segmenttree move(vector<ll>(n,0));
    for(int i=n-1;i>=0;i--){

        int l = i,r = n;
        while(r - l > 1){
            int m = (l+r)/2;
            if(xd[i].first+xd[i].second<=xd[m].first) r = m;
            else l = m;
        }

        if(l==i) move.update(i,i);
        else{
            ll p = move.query(i+1,r);
            move.update(i,p);
        }
    }
    vector<mint> dp(n,0);

    for(int i=n-1;i>=0;i--){
        if(i+1==n) dp[i] = 2;
        else if(move.getval(i)==n-1) dp[i] = dp[i+1] + 1;
        else dp[i] = dp[i+1] + dp[move.getval(i)+1];
    }
    cout << dp[0] << endl;

    return 0;
}

Measured memory_bytes: 9572