#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
using ppi = pair<pii, int>;
char s[2000100];
int st[2000100], ed[2000100], dp[2000100], sum[2000100];
char a[2000100], L[2000100], R[2000100];
int tmp[2000100], z[2000100];
void ZVAL(char *s, int n) {
  z[0] = 0;
  for (int i = 1, l = 0, r = 0; i < n; i++) {
    if (i <= r)
      z[i] = min(z[i - l], r - i + 1);
    else
      z[i] = 0;
    while (i + z[i] < n && s[i + z[i]] == s[z[i]]) z[i]++;
    if (i + z[i] - 1 > r) l = i, r = i + z[i] - 1;
  }
}
void ST_calc() {
  int nn = 0;
  for (int i = 0, t = strlen(L); i < t; i++) s[nn++] = L[i];
  s[nn++] = '$';
  int m = nn;
  for (int i = 0, t = strlen(a); i < t; i++) s[nn++] = a[i];
  ZVAL(s, nn);
  int n = strlen(a);
  for (int i = m; i <= nn - m + 1; i++) {
    if (z[i] == m - 1) {
      st[i - m] = i - 1;
      continue;
    }
    if (s[i] != '0') {
      if (s[i + z[i]] > s[z[i]])
        st[i - m] = i - 1;
      else if (i <= n)
        st[i - m] = i;
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    if (st[i] != -1) continue;
    if (a[i] == '0') st[i] = st[i + 1];
  }
}
void ED_calc() {
  int nn = 0;
  for (int i = 0, t = strlen(R); i < t; i++) s[nn++] = R[i];
  s[nn++] = '@';
  int m = nn;
  for (int i = 0, t = strlen(a); i < t; i++) s[nn++] = a[i];
  ZVAL(s, nn);
  for (int i = m; i <= nn - m + 1; i++) {
    if (z[i] == m - 1) {
      ed[i - m] = i - 1;
      continue;
    }
    if (s[i] != '0') {
      if (s[i + z[i]] < s[z[i]]) {
        ed[i - m] = i - 1;
        continue;
      }
      if (i > 2) ed[i - m] = i - 2;
    }
  }
  int n = strlen(a);
  for (int i = n - 1; i >= 0; i--) {
    if (i >= n - m + 2) {
      ed[i] = n;
      continue;
    }
    if (a[i] == '0' && i == n - 1) {
      ed[i] = n;
      continue;
    }
    if (a[i] == '0') ed[i] = ed[i + 1];
  }
}
int pos[2000100][2];
int main() {
  cin >> a;
  cin >> L;
  cin >> R;
  memset(st, -1, sizeof st);
  memset(ed, -1, sizeof ed);
  ST_calc();
  ED_calc();
  int n = strlen(a);
  int flag = 0;
  if (strlen(L) == 1 && L[0] == '0') flag = 1;
  dp[n + 1] = 1;
  sum[n + 1] = 1;
  for (int i = n; i >= 1; i--) {
    int l = st[i - 1], r = ed[i - 1];
    if (l != -1 && r != -1 && l <= r) {
      if (a[i - 1] != '0')
        dp[i] = (sum[l + 1] - sum[r + 2]) % 998244353;
      else if (l == i)
        dp[i] = dp[i + 1];
      dp[i] = (dp[i] + 998244353) % 998244353;
    }
    sum[i] = (sum[i + 1] + dp[i]) % 998244353;
  }
  cout << (dp[1] + 998244353) % 998244353 << endl;
  return 0;
}
