#include <bits/stdc++.h>
#pragma GCC optimize(3)
using namespace std;
template <class T>
void test(T a) {
  cout << a << endl;
}
template <class T, class T2>
void test(T a, T2 b) {
  cout << a << " " << b << endl;
}
template <class T, class T2, class T3>
void test(T a, T2 b, T3 c) {
  cout << a << " " << b << " " << c << endl;
}
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3fLL;
const int mod = 998244353;
const int N = 1e6 + 5;
char a[N], l[N], r[N];
int t1[N * 3], t2[N * 3], c[N * 3];
bool cmp(int *r, int a, int b, int l) {
  return r[a] == r[b] && r[a + l] == r[b + l];
}
void da(int str[], int sa[], int rnk[], int height[], int n, int m) {
  n++;
  int i, j, p, *x = t1, *y = t2;
  for (i = 0; i < m; i++) c[i] = 0;
  for (i = 0; i < n; i++) c[x[i] = str[i]]++;
  for (i = 1; i < m; i++) c[i] += c[i - 1];
  for (i = n - 1; i >= 0; i--) sa[--c[x[i]]] = i;
  for (j = 1; j <= n; j <<= 1) {
    p = 0;
    for (i = n - j; i < n; i++) y[p++] = i;
    for (i = 0; i < n; i++)
      if (sa[i] >= j) y[p++] = sa[i] - j;
    for (i = 0; i < m; i++) c[i] = 0;
    for (i = 0; i < n; i++) c[x[y[i]]]++;
    for (i = 1; i < m; i++) c[i] += c[i - 1];
    for (i = n - 1; i >= 0; i--) sa[--c[x[y[i]]]] = y[i];
    swap(x, y);
    p = 1;
    x[sa[0]] = 0;
    for (i = 1; i < n; i++)
      x[sa[i]] = cmp(y, sa[i - 1], sa[i], j) ? p - 1 : p++;
    if (p >= n) break;
    m = p;
  }
  int k = 0;
  n--;
  for (i = 0; i <= n; i++) rnk[sa[i]] = i;
  for (i = 0; i < n; i++) {
    if (k) k--;
    j = sa[rnk[i] - 1];
    while (str[i + k] == str[j + k]) k++;
    height[rnk[i]] = k;
  }
}
int rnk[N * 3], height[N * 3];
int R[N * 3];
int sa[N * 3];
struct segTree {
  int val;
} tree[N << 2];
void update(int o, int l, int r, int x, int y) {
  if (l == r) {
    tree[o].val = y;
    return;
  }
  int mid = l + r >> 1;
  int lo = o << 1;
  int ro = lo + 1;
  if (x <= mid) {
    update(lo, l, mid, x, y);
  } else {
    update(ro, mid + 1, r, x, y);
  }
  tree[o].val = tree[lo].val + tree[ro].val;
  if (tree[o].val > mod) tree[o].val -= mod;
}
int query(int o, int l, int r, int s, int e) {
  if (r < s || l > e) return 0;
  if (l >= s && r <= e) return tree[o].val;
  int mid = l + r >> 1;
  int lo = o << 1;
  int ro = lo + 1;
  int ans = query(lo, l, mid, s, e) + query(ro, mid + 1, r, s, e);
  if (ans > mod) ans -= mod;
  return ans;
}
int dp[N];
void work() {
  scanf("%s%s%s", a, l, r);
  int lena = strlen(a);
  int lenl = strlen(l);
  int lenr = strlen(r);
  int lstart = lena + 1;
  int rstart = lena + 1 + lenl + 1;
  for (int i = 0; i < (lena); i++) {
    R[i] = a[i] - '0' + 1;
  }
  R[lena] = 11;
  for (int i = 0; i < (lenl); i++) {
    R[i + lstart] = l[i] - '0' + 1;
  }
  R[rstart - 1] = 1;
  for (int i = 0; i < (lenr); i++) {
    R[i + rstart] = r[i] - '0' + 1;
  }
  int n = rstart + lenr;
  R[n] = 12;
  dp[lena] = 1;
  update(1, 0, lena, lena, 1);
  da(R, sa, rnk, height, n, 13);
  for (int i = lena - 1; i >= 0; --i) {
    if (a[i] == '0') {
      if (l[0] == '0') {
        dp[i] = dp[i + 1];
        update(1, 0, lena, i, dp[i]);
      }
      continue;
    }
    int L, R;
    if (lena - i < lenl) {
      L = i + lenl + 1;
    } else {
      if (rnk[i] > rnk[lstart]) {
        L = i + lenl;
      } else {
        L = i + lenl + 1;
      }
    }
    if (lena - i < lenr) {
      R = lena;
    } else {
      if (rnk[i] < rnk[rstart]) {
        R = i + lenr;
      } else {
        R = i + lenr - 1;
      }
    }
    if (L <= R) {
      dp[i] = query(1, 0, lena, L, R);
      update(1, 0, lena, i, dp[i]);
    }
  }
  printf("%d\n", dp[0]);
}
int main() {
  work();
  return 0;
}
