#include <bits/stdc++.h>
using namespace std;
const int N = 1000010;
char a[N], l[N], r[N];
int p1 = 13, p2 = 17, po[N], po2[N], tmp1, tmp2, tmp3, tmp4, n, m, k, low, high,
    mid, res;
bool ll[N], rr[N];
int dp[N], idx1, idx2, idx3 = 0, idx4 = 0, ss = 0, sum3[N], dp2[N];
struct H {
  vector<int> sum, sum2;
  H(int n, char *arr) {
    sum.resize(n + 1);
    sum2.resize(n + 1);
    for (int i = 0; i < n; i++) {
      sum[i + 1] = ((long long)(arr[i] - '0' + 1) * po[i] % 998244353);
      sum[i + 1] += sum[i];
      sum[i + 1] %= 998244353;
      sum2[i + 1] = ((long long)(arr[i] - '0' + 1) * po2[i] % 999999937);
      sum2[i + 1] += sum2[i];
      sum2[i + 1] %= 999999937;
    }
  }
  bool equal(int l, int r, int l2, int r2, H &other) {
    tmp1 = ((((sum[r + 1] - sum[l]) % 998244353) + 998244353) % 998244353);
    tmp2 = ((((sum2[r + 1] - sum2[l]) % 999999937) + 999999937) % 999999937);
    tmp3 = ((((other.sum[r2 + 1] - other.sum[l2]) % 998244353) + 998244353) %
            998244353);
    tmp4 = ((((other.sum2[r2 + 1] - other.sum2[l2]) % 999999937) + 999999937) %
            999999937);
    if (l < l2) {
      tmp1 = (long long)tmp1 * po[l2 - l] % 998244353;
      tmp2 = (long long)tmp2 * po2[l2 - l] % 999999937;
    } else if (l2 < l) {
      tmp3 = (long long)tmp3 * po[l - l2] % 998244353;
      tmp4 = (long long)tmp4 * po2[l - l2] % 999999937;
    }
    return (tmp1 == tmp3 && tmp2 == tmp4);
  }
};
int main() {
  po[0] = po2[0] = 1;
  for (int i = 1; i < N; i++) {
    po[i] = (long long)po[i - 1] * p1 % 998244353;
    po2[i] = (long long)po2[i - 1] * p2 % 999999937;
  }
  scanf("%s%s%s", a, l, r);
  n = strlen(a), m = strlen(l), k = strlen(r);
  H A(n, a), L(m, l), R(k, r);
  for (int i = 0; i < n; i++) {
    ll[i] = rr[i] = false;
    if (i + m - 1 < n) {
      low = 1, high = m, res = 0;
      while (high >= low) {
        mid = (low + high) / 2;
        if (A.equal(i, i + mid - 1, 0, mid - 1, L)) {
          res = mid;
          low = mid + 1;
        } else
          high = mid - 1;
      }
      if (res == m || a[i + res] > l[res]) ll[i] = true;
    }
    if (i + k - 1 < n) {
      low = 1, high = k, res = 0;
      while (high >= low) {
        mid = (low + high) / 2;
        if (A.equal(i, i + mid - 1, 0, mid - 1, R)) {
          res = mid;
          low = mid + 1;
        } else
          high = mid - 1;
      }
      if (res == k || a[i + res] < r[res]) rr[i] = true;
    }
  }
  dp[n] = 1;
  idx4 = n, idx3 = n + 1, ss = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (a[i] == '0') {
      if (m == 1 && l[0] == '0')
        dp[i] = dp[i + 1];
      else
        dp[i] = 0;
      continue;
    }
    if (ll[i])
      idx1 = i + m;
    else
      idx1 = i + m + 1;
    if (rr[i])
      idx2 = i + k;
    else
      idx2 = i + k - 1;
    if (idx1 > n) continue;
    if (idx2 > n) idx2 = n;
    while (idx3 > idx1) {
      ss += dp[--idx3];
      ss %= 998244353;
    }
    while (idx4 > idx2) {
      ss -= dp[idx4--];
      ss %= 998244353;
      ss += 998244353;
      ss %= 998244353;
    }
    dp[i] = ss;
  }
  cout << dp[0] << endl;
  return 0;
}
