#include <bits/stdc++.h>
using namespace std;
vector<int> v, v1;
long long dp[1000005], pre[1000005];
vector<int> zalgo(string s) {
  int i, j, l, r, k;
  l = 0;
  r = 0;
  vector<int> vec;
  vec.push_back(s.length());
  for (i = 1; i < s.length(); i++) {
    if (r < i) {
      l = i;
      r = i;
      j = 0;
      while (r < s.length() && s[r] == s[j]) {
        r++;
        j++;
      }
      r--;
      vec.push_back(r - l + 1);
    } else {
      k = i - l;
      if (vec[k] < (r - i + 1)) {
        vec.push_back(vec[k]);
      } else {
        j = r - i + 1;
        l = i;
        r++;
        while (r < s.length() && s[r] == s[j]) {
          r++;
          j++;
        }
        r--;
        vec.push_back(r - l + 1);
      }
    }
  }
  return vec;
}
int main() {
  std::ios::sync_with_stdio(false);
  string a, l, r, l1, r1;
  long long i, val, lo, hi;
  cin >> a >> l >> r;
  l1 = l + '&' + a;
  r1 = r + '&' + a;
  v = zalgo(l1);
  v1 = zalgo(r1);
  int n = a.length();
  dp[n] = 1;
  pre[n] = 1;
  for (i = n - 1; i >= 0; i--) {
    if (a[i] == '0') {
      if (l == "0") {
        dp[i] = dp[i + 1];
      }
      pre[i] = pre[i + 1] + dp[i];
      pre[i] %= (998244353LL);
      continue;
    }
    lo = i + l.length() - 1;
    hi = i + r.length() - 1;
    if (lo >= a.length()) {
      dp[i] = 0;
      pre[i] = pre[i + 1];
      continue;
    }
    val = v[l.length() + i + 1];
    if (val != l.length() && l[val] > a[i + val]) {
      lo++;
    }
    if (hi >= a.length()) {
      hi = a.length() - 1;
    } else {
      val = v1[r.length() + i + 1];
      if (val != r.length() && r[val] < a[i + val]) {
        hi--;
      }
    }
    if (lo > hi) {
      dp[i] = 0;
      pre[i] = pre[i + 1];
      continue;
    } else {
      dp[i] = pre[lo + 1] - pre[hi + 2];
      dp[i] %= (998244353LL);
      dp[i] += (998244353LL);
      dp[i] %= (998244353LL);
      pre[i] = pre[i + 1] + dp[i];
      pre[i] %= (998244353LL);
    }
  }
  cout << dp[0] << endl;
}
