#include <bits/stdc++.h>
using namespace std;
const int INF = 0x7FFFFFFF;
const long long LINF = 0x7FFFFFFFFFFFFF;
void guan() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
const long long mod = 998244353;
const int maxn = 1010101;
char a[maxn], l[maxn], r[maxn];
long long t[maxn << 2];
char s[maxn * 2];
int nxtl[maxn * 2], nxtr[maxn * 2];
void exkmp(int nxt[], char *s1, char *s2) {
  int l = strlen(s1), l2 = strlen(s2);
  for (int i = 1; i <= l; i++) s[i] = s1[i - 1];
  for (int i = 1; i <= l2; i++) s[i + l] = s2[i - 1];
  l = l + l2;
  nxt[1] = l;
  int x = 1;
  while (s[x] == s[x + 1] && x + 1 <= l) x++;
  nxt[2] = x - 1;
  int k = 2;
  for (int i = 3; i <= l; i++) {
    int pp = k + nxt[k] - 1, L = nxt[i - k + 1];
    if (i + L < pp + 1)
      nxt[i] = L;
    else {
      int j = pp - i + 1;
      if (j < 0) j = 0;
      while (s[j + 1] == s[i + j] && i + j <= l) j++;
      nxt[i] = j;
      k = i;
    }
  }
  int temp = strlen(s1);
  for (int i = strlen(s1) + 1; i <= l; i++) {
    nxt[i - temp] = min(nxt[i], temp);
  }
}
int len1, len2;
int Cal(int mk, char s[], int pos, char t[]) {
  int to;
  if (mk == 0) {
    if (len1 == nxtl[pos + 1])
      to = nxtl[pos + 1] + pos;
    else {
      if (s[pos + nxtl[pos + 1]] < t[nxtl[pos + 1]])
        to = pos + len1 + 1;
      else
        to = pos + len1;
    }
  } else {
    if (len2 == nxtr[pos + 1])
      to = nxtr[pos + 1] + pos;
    else {
      if (s[pos + nxtr[pos + 1]] < t[nxtr[pos + 1]])
        to = pos + len2;
      else
        to = pos + len2 - 1;
    }
  }
  return to;
}
int n;
long long c[maxn << 2];
void add(int x, long long val) {
  while (x <= n) {
    c[x] = (c[x] + val) % mod;
    x += (x & (-x));
  }
}
long long query(int x) {
  long long sum = 0;
  if (x == 0) return 1;
  while (x > 0) {
    sum = (sum + c[x]) % mod;
    x -= (x & (-x));
  }
  return sum;
}
void updata(int l, int r, long long sum) {
  if (l > r) return;
  add(l, sum);
  add(r + 1, mod - sum);
}
int main() {
  guan();
  long long m, d, h, k;
  long long st = 1e9 + 1;
  while (cin >> a >> l >> r) {
    n = strlen(a);
    int cnum = n;
    memset(c, 0, sizeof(c));
    int len = strlen(l);
    int pos = -1;
    for (int i = 0; i < len; i++) {
      if (pos == -1 && l[i] == '0')
        continue;
      else
        l[++pos] = l[i];
    }
    if (pos == -1) l[++pos] = '0';
    l[++pos] = 0;
    pos = -1;
    len = strlen(r);
    for (int i = 0; i < len; i++) {
      if (pos == -1 && r[i] == '0')
        continue;
      else
        r[++pos] = r[i];
    }
    if (pos == -1) r[++pos] = '0';
    r[++pos] = 0;
    len1 = strlen(l), len2 = strlen(r);
    exkmp(nxtl, l, a);
    exkmp(nxtr, r, a);
    for (int i = 0; i < n; i++) {
      long long sum = query(i);
      sum = (sum + mod) % mod;
      if (a[i] == '0') {
        if (l[0] == '0') updata(i + 1, i + 1, sum);
        continue;
      }
      updata(Cal(0, a, i, l), min(int(n), Cal(1, a, i, r)), sum);
    }
    cout << query(n) << endl;
  }
  return 0;
}
