#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast", "unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
const long long inf = numeric_limits<long long>::max() / 2;
const long double eps = 1e-9;
const long double pi = acos(-1);
template <typename T>
inline bool mineq(T& a, T b) {
  return (a > b) ? (a = b, 1) : 0;
}
template <typename T>
inline bool maxeq(T& a, T b) {
  return (a < b) ? (a = b, 1) : 0;
}
inline void solve(), read();
const string file = "";
int main() {
  if (file != "") {
    freopen((file + ".in").c_str(), "r", stdin);
    freopen((file + ".out").c_str(), "w", stdout);
  }
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  ;
  read();
  solve();
  return 0;
}
const long long R = 998244353;
string a, l, r;
long long n;
vector<long long> dp, suff;
vector<long long> zl, zr;
void zet(string s, vector<long long>& z) {
  long long n = (long long)((s).size());
  z.assign(n, 0);
  z[0] = 0;
  for (long long i = 1, l = 0, r = 0; i < n; i++) {
    if (i <= r) {
      z[i] = min(z[i - l], r - i);
    }
    while (i + z[i] < n && s[z[i]] == s[i + z[i]]) {
      ++z[i];
    }
    if (i + z[i] - 1 > r) {
      r = i + z[i] - 1;
      l = i;
    }
  }
}
inline void solve() {
  zet(l + "#" + a, zl);
  zet(r + "#" + a, zr);
  dp.assign(n + 2, 0);
  suff.assign(n + 2, 0);
  long long ans = 0;
  dp[n] = 1;
  suff[n] = 1;
  for (long long i = n - 1; i >= 0; i--) {
    if (a[i] == '0') {
      if (l == "0") {
        dp[i] = dp[i + 1];
      }
      suff[i] = (dp[i] + suff[i + 1]) % ::R;
      continue;
    }
    long long L = i + (long long)((l).size());
    long long R = i + (long long)((r).size());
    long long sleft = zl[(long long)((l).size()) + 1 + i];
    long long sright = zr[(long long)((r).size()) + 1 + i];
    if (sleft != (long long)((l).size())) {
      if (a[i + sleft] < l[sleft]) {
        ++L;
      }
    }
    if (sright != (long long)((r).size())) {
      if (a[i + sright] > r[sright]) {
        --R;
      }
    }
    if (L <= R && L <= n) {
      mineq(R, n);
      dp[i] = (suff[L] - suff[R + 1] + ::R) % ::R;
    }
    suff[i] = (dp[i] + suff[i + 1]) % ::R;
  }
  cout << dp[0] << "\n";
}
inline void read() {
  cin >> a >> l >> r;
  n = (long long)((a).size());
}
