#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 100;
const int MOD = 998244353;
const int oo = 1e9 + 100;
const long double EPS = 1e-9;
char a[MAXN], l[MAXN], r[MAXN];
int sza, szl, szr;
int acc[MAXN], dp[MAXN];
inline int add(int a, int b) { return a + b >= MOD ? a + b - MOD : a + b; }
inline int sbt(int a, int b) { return a - b < 0 ? a - b + MOD : a - b; }
vector<int> z_algorithm(string s) {
  int n = s.size();
  vector<int> z(n);
  int x = 0, y = 0;
  for (int i = 1; i < n; ++i) {
    z[i] = max(0, min(z[i - x], y - i + 1));
    while (i + z[i] < n && s[z[i]] == s[i + z[i]]) x = i, y = i + z[i], z[i]++;
  }
  return z;
}
int main() {
  while (scanf("%s %s %s", a, l, r) == 3) {
    sza = strlen(a);
    szl = strlen(l);
    szr = strlen(r);
    vector<int> zl = z_algorithm(string(l) + "#" + string(a));
    vector<int> zr = z_algorithm(string(r) + "#" + string(a));
    acc[sza + 1] = dp[sza + 1] = 0;
    acc[sza] = dp[sza] = 1;
    for (int i = sza - 1; i >= 0; --i) {
      if (a[i] == '0')
        dp[i] = (szl == 1 && l[0] == '0' ? dp[i + 1] : 0);
      else {
        int fr = i + szl - 1, to = i + szr - 1, len_pref;
        len_pref = zl[szl + 1 + i];
        if (len_pref != szl && a[i + len_pref] < l[len_pref]) fr++;
        len_pref = zr[szr + 1 + i];
        if (len_pref != szr && a[i + len_pref] > r[len_pref]) to--;
        fr = fr + 1;
        to = min(to + 1, sza);
        dp[i] = 0;
        if (fr <= to) dp[i] = sbt(acc[fr], acc[to + 1]);
      }
      acc[i] = add(dp[i], acc[i + 1]);
    }
    printf("%d\n", dp[0]);
  }
  return 0;
}
