#include <bits/stdc++.h>
using namespace std;
bool home = 1;
signed realMain();
signed main() {
  home = 0;
  if (home) {
    freopen("input", "r", stdin);
  } else {
    ios::sync_with_stdio(0);
    cin.tie(0);
  }
  realMain();
}
const long long M = 998244353;
long long add(long long a, long long b) {
  a += b;
  if (a >= M) return a - M;
  if (a < 0) a += M;
  return a;
}
long long mul(long long a, long long b) { return a * (long long)b % M; }
long long pw(long long a, long long b) {
  long long r = 1;
  while (b) {
    if (b & 1) {
      r = mul(r, a);
    }
    a = mul(a, a);
    b /= 2;
  }
  return r;
}
long long dv(long long a, long long b) { return mul(a, pw(b, M - 2)); }
vector<long long> zz(string s) {
  long long n = (long long)s.length();
  vector<long long> z(n);
  for (long long i = 1, l = 0, r = 0; i < n; ++i) {
    if (i <= r) z[i] = min(r - i + 1, z[i - l]);
    while (i + z[i] < n && s[z[i]] == s[i + z[i]]) ++z[i];
    if (i + z[i] - 1 > r) l = i, r = i + z[i] - 1;
  }
  return z;
}
const long long N = 1000000 + 7;
long long dp[N], sa, sl, sr, cl[N], cr[N], suf[N];
string a, l, r, la, ra;
bool smaller_r(long long i, long long len) {
  if (len < sr) return 1;
  if (len > sr) return 0;
  long long com = cr[i];
  if (com >= len) return 1;
  return a[i + com] < r[com];
}
bool smaller_l(long long i, long long len) {
  if (len < sl) return 1;
  if (len > sl) return 0;
  long long com = cl[i];
  if (com >= len) return 0;
  return a[i + com] < l[com];
}
long long find_last_brute(long long i) {
  long long j = i - 1;
  j = min(sa - 1, i + sr - 2);
  if (j + 1 < sa && smaller_r(i, j + 2 - i)) {
    j++;
  }
  return j;
}
long long find_first_brute(long long i) {
  long long j = i - 1;
  j = min(sa, j + sl - 2);
  long long s = 0;
  while (j < sa && smaller_l(i, j + 1 - i)) {
    j++;
    s++;
  }
  assert(s <= 3);
  if (j == sa) return N;
  return j;
}
signed realMain() {
  cin >> a >> l >> r;
  la = l + "$" + a;
  ra = r + "$" + a;
  vector<long long> r1 = zz(la), r2 = zz(ra);
  sa = (long long)a.size();
  sl = (long long)l.size();
  sr = (long long)r.size();
  for (long long i = 0; i < sa; i++) {
    cl[i] = r1[i + sl + 1];
    cr[i] = r2[i + sr + 1];
  }
  bool zero = (l == "0");
  dp[sa] = 1;
  suf[sa] = 1;
  for (long long i = sa - 1; i >= 0; i--) {
    if (a[i] == '0') {
      dp[i] = dp[i + 1] * zero;
      suf[i] = add(suf[i + 1], dp[i]);
      continue;
    }
    long long first = find_first_brute(i);
    long long last = find_last_brute(i);
    if (first <= last) {
      first++;
      last++;
      dp[i] = add(suf[first], -suf[last + 1]);
    }
    suf[i] = add(suf[i + 1], dp[i]);
  }
  cout << dp[0] << "\n";
  return 0;
}
