#include <bits/stdc++.h>
using namespace std;
long long mod = 998244353;
vector<long long> t;
vector<int> z(string s) {
  int n = s.size(), l = 0, r = 0;
  vector<int> z(n);
  for (int i = 1; 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;
}
void upd(int v, int l, int r, int tl, int tr, long long x) {
  if (tl > tr) return;
  if (l == tl && r == tr) {
    t[v] = (t[v] + x) % mod;
    return;
  }
  int m = (r + l) / 2;
  upd(2 * v, l, m, tl, min(tr, m), x);
  upd(2 * v + 1, m + 1, r, max(tl, m + 1), tr, x);
}
long long get(int v) {
  long long ret = 0;
  while (v != 0) {
    ret = (ret + t[v]) % mod;
    v /= 2;
  }
  return ret;
}
int main() {
  int n, m = 1, x, y;
  string p, l, r;
  cin >> p >> l >> r;
  bool cond = (l == "0");
  vector<int> a = z(l + "#" + p), b = z(r + "#" + p);
  n = p.size();
  x = l.size();
  y = r.size();
  vector<pair<int, int> > g(n);
  for (int i = 0; i < n; i++) {
    if (i + x - 1 >= n) {
      g[i].first = -1;
    } else {
      if (a[i + x + 1] == x || p[i + a[i + x + 1]] > l[a[i + x + 1]])
        g[i].first = i + x - 1;
      else if (i + x < n)
        g[i].first = i + x;
      else
        g[i].first = -1;
    }
    if (i + y - 1 >= n) {
      g[i].second = n - 1;
    } else {
      if (b[i + y + 1] == y || p[i + b[i + y + 1]] < r[b[i + y + 1]])
        g[i].second = i + y - 1;
      else
        g[i].second = i + y - 2;
    }
  }
  while (m < n + 1) m *= 2;
  t.resize(2 * m, 0);
  vector<long long> dp(n + 1, 0);
  dp[0] = 1;
  for (int i = 1; i <= n; i++) {
    if (g[i - 1].first == -1) {
      dp[i] = get(m + i);
      continue;
    }
    if (p[i - 1] == '0') {
      dp[i] = get(m + i);
      if (cond) dp[i] = (dp[i] + dp[i - 1]) % mod;
      continue;
    }
    upd(1, 0, m - 1, g[i - 1].first + 1, g[i - 1].second + 1, dp[i - 1]);
    dp[i] = get(m + i);
  }
  cout << dp[n];
}
