#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
long long dp[N];
long long sdp[N];
long long zdp[N];
const long long BASE = 1009;
const long long MOD = 998244353;
long long base[N];
long long ahash[N];
long long lh[N];
long long rh[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string a, l, r;
  cin >> a >> l >> r;
  int size = a.size();
  base[0] = 1;
  for (int i = 1; i <= size; i += 1) base[i] = base[i - 1] * BASE % MOD;
  for (int i = 1; i <= size; i += 1) {
    int add = a[i - 1] - '0';
    ahash[i] = (ahash[i - 1] * BASE + add) % MOD;
  }
  for (int i = 1; i <= l.size(); i += 1) {
    int add = l[i - 1] - '0';
    lh[i] = (lh[i - 1] * BASE + add) % MOD;
  }
  for (int i = 1; i <= r.size(); i += 1) {
    int add = r[i - 1] - '0';
    rh[i] = (rh[i - 1] * BASE + add) % MOD;
  }
  dp[0] = 1;
  sdp[0] = 1;
  for (int i = 1; i <= size; i += 1) {
    if (i < l.size()) {
      dp[i] = 0;
      sdp[i] = sdp[i - 1];
      zdp[i] = zdp[i - 1];
    } else {
      int s = i - l.size();
      int ll = 0, rr = l.size() - 1;
      while (ll <= rr) {
        int m = (ll + rr) / 2;
        bool eq = true;
        long long ah =
            ((ahash[s + m + 1] - ahash[s] * base[m + 1]) % MOD + MOD) % MOD;
        if (ah != lh[m + 1]) eq = false;
        if (eq)
          ll = m + 1;
        else
          rr = m - 1;
      }
      if (ll < l.size() && a[s + ll] < l[ll]) s -= 1;
      int e = i - r.size();
      if (e < 0)
        ;
      else {
        int ll = 0, rr = r.size() - 1;
        while (ll <= rr) {
          int m = (ll + rr) / 2;
          bool eq = true;
          long long ah =
              ((ahash[e + m + 1] - ahash[e] * base[m + 1]) % MOD + MOD) % MOD;
          if (ah != rh[m + 1]) eq = false;
          if (eq)
            ll = m + 1;
          else
            rr = m - 1;
        }
        if (ll < r.size() && a[e + ll] > r[ll]) e += 1;
        e -= 1;
      }
      if (e < 0) {
        dp[i] = ((sdp[s] - zdp[s]) % MOD + MOD) % MOD;
      } else {
        dp[i] = ((sdp[s] - sdp[e] - (zdp[s] - zdp[e])) % MOD + MOD) % MOD;
      }
      sdp[i] = (sdp[i - 1] + dp[i]) % MOD;
      if (a[i - 1] == '0') {
        zdp[i - 1] = (zdp[i - 1] + dp[i - 1]) % MOD;
      }
      zdp[i] = zdp[i - 1];
    }
  }
  cout << dp[size] << endl;
}
