#include <bits/stdc++.h>
using namespace std;
char s[1000005], l[1000005], r[1000005];
long long f[1000005], sum[1000005], hashs[1000005], hashl[1000005],
    hashr[1000005], Pow[1000005];
int n, sl, sr, pl[1000005], pr[1000005];
bool pan1(int x) {
  if (x + sl - 1 > n) return false;
  if (sl == pl[x]) return true;
  return l[pl[x] + 1] < s[x + pl[x]];
}
bool pan2(int x) {
  if (x + sr - 1 > n) return false;
  if (pr[x] == sr) return true;
  return r[pr[x] + 1] > s[x + pr[x]];
}
void gethash(char str[], long long hash[], int len) {
  for (int i = 1; i <= len; i++)
    hash[i] = (hash[i - 1] * 11ll + str[i] - '0' + 1) % 998244353;
}
long long hashval(long long hash[], int l, int r) {
  return (hash[r] - hash[l - 1] * Pow[r - l + 1] % 998244353 + 998244353) %
         998244353;
}
void solve(int p[], long long hash[], int len) {
  for (int i = 1; i <= n - len + 1; i++) {
    int ll = 0, rr = len, num;
    while (ll <= rr) {
      int mid = (ll + rr) >> 1;
      if (hashval(hashs, i, i + mid - 1) == hashval(hash, 1, mid)) {
        num = mid;
        ll = mid + 1;
      } else
        rr = mid - 1;
    }
    p[i] = num;
  }
}
int main() {
  Pow[0] = 1;
  for (int i = 1; i <= 1000000; i++) Pow[i] = Pow[i - 1] * 11ll % 998244353;
  scanf("%s%s%s", s + 1, l + 1, r + 1);
  n = strlen(s + 1);
  sl = strlen(l + 1);
  sr = strlen(r + 1);
  gethash(l, hashl, sl);
  gethash(r, hashr, sr);
  gethash(s, hashs, n);
  f[0] = 1;
  solve(pl, hashl, sl);
  solve(pr, hashr, sr);
  for (int i = 0; i <= n; i++) {
    if (i) {
      sum[i] += sum[i - 1];
      f[i] = (f[i] + sum[i]) % 998244353;
    }
    if (s[i + 1] == '0') {
      if (sl == 1 && l[1] == '0') f[i + 1] = (f[i + 1] + f[i]) % 998244353;
      continue;
    }
    if (sl < sr) {
      sum[sl + i + 1] = (sum[sl + i + 1] + f[i]) % 998244353;
      sum[sr + i] = (sum[sr + i] + 998244353 - f[i]) % 998244353;
    }
    if (sl == sr) {
      if (pan1(i + 1) && pan2(i + 1))
        f[i + sl] = (f[i + sl] + f[i]) % 998244353;
    } else {
      if (pan1(i + 1)) f[i + sl] = (f[i + sl] + f[i]) % 998244353;
      if (pan2(i + 1)) f[i + sr] = (f[i + sr] + f[i]) % 998244353;
    }
  }
  printf("%lld\n", f[n]);
}
