#include <bits/stdc++.h>
using namespace std;
const int OO = (int)1e9;
const double eps = 1e-10;
vector<int> z_function(string s) {
  int n = (int)s.length();
  vector<int> z(n);
  for (int 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 int MX = 1e6 + 5, MOD = 998244353;
int dp[MX], dpSum[MX];
string a, l, r;
int main() {
  ios::sync_with_stdio(false);
  cout.precision(10);
  cin >> a >> l >> r;
  string s = l + "$" + a;
  string t = r + "$" + a;
  vector<int> zL = z_function(s);
  vector<int> zR = z_function(t);
  int n = int(a.size());
  dp[n] = dpSum[n] = 1;
  for (int i = n - 1; i >= int(0); --i) {
    int lIdx = i + int(l.size());
    int pos = zL[i + int(l.size()) + 1];
    if (pos < int(l.size()) && a[i + pos] < l[pos]) ++lIdx;
    int rIdx = i + int(r.size());
    pos = zR[i + int(r.size()) + 1];
    if (pos < int(r.size()) && a[i + pos] > r[pos]) --rIdx;
    if (a[i] == '0') {
      if (l == "0")
        dp[i] = dp[i + 1];
      else
        dp[i] = 0;
    } else if (lIdx <= rIdx && lIdx <= n) {
      rIdx = min(rIdx, n);
      dp[i] = (dpSum[lIdx] - dpSum[rIdx + 1] + MOD) % MOD;
    }
    dpSum[i] = (dp[i] + dpSum[i + 1]) % MOD;
  }
  cout << dp[0];
  return 0;
}
