#include <bits/stdc++.h>
using namespace std;
const int mn = 1e6 + 5;
const int mod = 998244353;
char a[mn];
char l[mn], r[mn];
long long d[mn], s[mn];
unsigned long long ha[mn], hl[mn], hr[mn], hc[mn];
int n, ln, rn;
inline int idx(char u) { return u - '0' + 1; }
const int seed = 131;
void getStringHash(char *s, unsigned long long *h, int n) {
  h[0] = 0;
  for (int i = 1; i <= n; i++) {
    h[i] = h[i - 1] * seed + idx(s[i]);
  }
}
void gethash() {
  getStringHash(a, ha, n);
  getStringHash(l, hl, ln);
  getStringHash(r, hr, rn);
  hc[0] = 1;
  for (int i = 1; i <= n; i++) {
    hc[i] = hc[i - 1] * seed;
  }
}
unsigned long long getHashString(int l, int r, unsigned long long *h) {
  int n = r - l;
  l--;
  r--;
  return h[r] - h[l] * hc[n];
}
bool Compare(int al, int ar, char *l, unsigned long long *h, int m,
             bool equal) {
  if (equal == 0 && ar > n + 1) return 1;
  int n = ar - al;
  if (n != m) return n > m;
  int L = 1, R = n, ans = 0;
  while (L <= R) {
    int mid = L + R >> 1;
    unsigned long long u, v;
    if ((u = getHashString(al, al + mid, ha)) ==
            (v = getHashString(1, mid + 1, h)) &&
        a[al + mid / 2 + 1 - 1] == l[mid / 2 + 1])
      ans = mid, L = mid + 1;
    else
      R = mid - 1;
  }
  if (ans == m) return equal;
  assert(a[al + ans] != l[ans + 1]);
  return a[al + ans] > l[ans + 1];
}
int main() {
  scanf("%s%s%s", a + 1, l + 1, r + 1);
  n = strlen(a + 1);
  ln = strlen(l + 1);
  rn = strlen(r + 1);
  gethash();
  int L, R;
  L = R = n + 1;
  s[n + 1] = d[n + 1] = 1;
  for (int i = n; i; i--) {
    if (a[i] != '0') {
      while (i < L - 1 && (Compare(i, L - 1, l, hl, ln, 1) || a[i] == '0')) L--;
      while (i < R - 1 && (Compare(i, R, r, hr, rn, 0) || a[i] == '0')) R--;
      if (Compare(i, L, l, hl, ln, 1) && Compare(i, R + 1, r, hr, rn, 0) &&
          !Compare(i, R, r, hr, rn, 0))
        d[i] = (s[L] - s[R + 1]) % mod;
    } else {
      if (l[1] == '0') d[i] = d[i + 1];
    }
    s[i] = (s[i + 1] + d[i]) % mod;
  }
  printf("%lld\n", (d[1] + mod) % mod);
  return 0;
}
