#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
const double EPS = 1e-12;
int F[1000210];
struct BIT {
  int c[1000210];
  void insert(int x, int v) {
    x += 10;
    while (x < 1000210) {
      c[x] += v;
      if (c[x] >= mod) c[x] -= mod;
      x += x & (-x);
    }
  }
  int S(int x) {
    int res = 0;
    while (x) {
      res += c[x];
      if (res >= mod) res -= mod;
      x -= x & (-x);
    }
    return res;
  }
  int query(int l, int r) {
    l += 10, r += 10;
    int res = S(r) - S(l - 1);
    if (res < 0) res += mod;
    return res;
  }
} tr;
void GetNext(string T, int next[]) {
  int t_len = T.size();
  next[0] = t_len;
  int a;
  int p;
  for (int i = 1, j = -1; i < t_len; i++, j--) {
    if (j < 0 || i + next[i - a] >= p) {
      if (j < 0) p = i, j = 0;
      while (p < t_len && T[p] == T[j]) p++, j++;
      next[i] = j;
      a = i;
    } else
      next[i] = next[i - a];
  }
}
void GetExtend(string S, string T, int extend[], int next[]) {
  GetNext(T, next);
  int a;
  int p;
  int s_len = S.size();
  int t_len = T.size();
  for (int i = 0, j = -1; i < s_len; i++, j--) {
    if (j < 0 || i + next[i - a] >= p) {
      if (j < 0) p = i, j = 0;
      while (p < s_len && j < t_len && S[p] == T[j]) p++, j++;
      extend[i] = j;
      a = i;
    } else
      extend[i] = next[i - a];
  }
}
int main() {
  string a, l, r;
  static int lcp1[1000210], lcp2[1000210], nxt1[1000210], nxt2[1000210];
  cin >> a >> l >> r;
  GetNext(l, nxt1);
  GetExtend(a, l, lcp1, nxt1);
  GetNext(r, nxt2);
  GetExtend(a, r, lcp2, nxt2);
  int n = a.size();
  tr.insert(-1, 1);
  for (int i = 0; i < n; ++i) {
    int pl, pr;
    pl = i - l.size() + 1;
    if (pl < 0) continue;
    if (lcp1[pl] != l.size() && a[pl + lcp1[pl]] < l[lcp1[pl]]) --pl;
    if (pl < 0) continue;
    pr = i - r.size() + 1;
    if (pr >= 0) {
      if (lcp2[pr] != r.size() && a[pr + lcp2[pr]] > r[lcp2[pr]]) ++pr;
    } else
      pr = 0;
    if (pr > pl) continue;
    F[i] = tr.query(pr - 1, pl - 1);
    if (a[i] == '0' && l == "0") (F[i] += F[i - 1]) %= mod;
    if (i + 1 < n && a[i + 1] != '0') tr.insert(i, F[i]);
  }
  printf("%d\n", F[n - 1]);
  return 0;
}
