#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, fu = 0;
  char ch = getchar();
  for (; ch < 48 || ch > 57; ch = getchar()) fu |= (ch == '-');
  for (; ch > 47 && ch < 58; ch = getchar()) x = x * 10 + ch - '0';
  return fu ? -x : x;
}
char a[1000005], l[1000005], r[1000005];
int dp[1000005], sum[1000005], n, nl, nr;
namespace String {
char s[2000005];
struct z_func {
  int z[2000005];
  void get_z() {
    int l = strlen(s);
    for (int i = 1, po = 0, mxr = 0; i < l; i++) {
      if (i <= mxr) z[i] = min(mxr - i + 1, z[i - po]);
      for (; i + z[i] < l && s[z[i]] == s[i + z[i]]; z[i]++)
        ;
      if (i + z[i] - 1 > mxr) po = i, mxr = i + z[i] - 1;
    }
  }
  bool sml(char *b, int len, int po) {
    return (n - po < len) ? 1
                          : (z[len + 1 + po] != len &&
                             a[po + z[len + 1 + po]] < b[z[len + 1 + po]]);
  }
  bool big(char *b, int len, int po) {
    return (n - po < len) ? 0
                          : (z[len + 1 + po] != len &&
                             a[po + z[len + 1 + po]] >= b[z[len + 1 + po]]);
  }
  int cmp(char *t, int pos) {
    int len = strlen(t);
    if (n - pos < len) return -1;
    int x = z[len + 1 + pos];
    if (x == len) return 0;
    if (a[pos + x] < t[x]) return -1;
    return 1;
  }
};
void build(char *a, char x, char *b) {
  int n1 = strlen(a), n2 = strlen(b), i, l = n1 + n2;
  for (i = 0; i < n1; i++) s[i] = a[i];
  for (s[i++] = x; i <= l; i++) s[i] = b[i - n1 - 1];
}
}  // namespace String
using namespace String;
z_func z1, z2;
int main() {
  scanf("%s%s%s", a, l, r);
  build(l, '^', a), z1.get_z(), nl = strlen(l);
  build(r, '^', a), z2.get_z(), nr = strlen(r);
  n = strlen(a), dp[n] = sum[n] = 1;
  for (int i = n - 1; i >= 0; sum[i] = (sum[i + 1] + dp[i]) % 998244353, i--) {
    if (a[i] == '0') {
      dp[i] = (nl == 1 && l[0] == '0') ? dp[i + 1] : 0;
    } else {
      int lpo = nl + i, rpo = nr + i;
      if (z1.sml(l, nl, i)) lpo++;
      if (z2.big(r, nr, i)) rpo--;
      if (lpo <= rpo && lpo <= n) {
        dp[i] = sum[lpo];
        if (rpo < n) dp[i] = (dp[i] - sum[rpo + 1] + 998244353) % 998244353;
      }
    }
  }
  printf("%d\n", dp[0]);
  return 0;
}
