#include <bits/stdc++.h>
using namespace std;
string a, l, r;
int ll[3000000], rr[3000000];
int kmp[3000000];
long long dp[2000002];
long long sums[2000002];
void build(string str, int arr[]) {
  int n = (int)str.length();
  for (int i = 1, L = 0, R = 0; i < n; ++i) {
    if (i <= R) arr[i] = min(R - i + 1, arr[i - L]);
    while (i + arr[i] < n && str[arr[i]] == str[i + arr[i]]) ++arr[i];
    if (i + arr[i] - 1 > R) L = i, R = i + arr[i] - 1;
  }
}
long long getVal(int index) {
  int len = a.length();
  if (len - index < l.length()) return 0;
  int x, y;
  if (a[index] == '0') {
    if (l == "0") {
      x = index;
      y = index;
      x++;
      y++;
      return ((sums[x] - (y <= len ? sums[y + 1] : 0)) + 998244353) % 998244353;
    } else
      return 0;
  }
  x = (index + l.length());
  int val = ll[l.length() + 1 + index];
  if (val < l.length() && a[index + val] < l[val]) x++;
  y = index + r.length();
  if (len - index < r.length())
    y = len;
  else {
    val = rr[r.length() + 1 + index];
    if (val < r.length() && a[index + val] > r[val]) y--;
  }
  if (x > y) return 0;
  return ((sums[x] - (y < len ? sums[y + 1] : 0)) + 998244353) % 998244353;
}
int main() {
  cin >> a >> l >> r;
  build(l + "$" + a, ll);
  build(r + "$" + a, rr);
  sums[a.length()] = 1;
  dp[a.length()] = 1;
  for (int i = a.length() - 1; i >= 0; i--) {
    dp[i] = getVal(i);
    sums[i] = dp[i];
    sums[i] = (sums[i] + sums[i + 1]) % 998244353;
  }
  cout << dp[0] << endl;
  return 0;
}
