#include <bits/stdc++.h>
using namespace std;
long long read() {
  long long x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * f;
}
template <class T1, class T2, class T3 = int>
inline void addmodfast(T1 &x, T2 y, T3 m) {
  x += y;
  if (x >= m) x -= m;
}
string a, l, r;
long long dp[1010101];
vector<int> prefix_function(string s) {
  int n = (int)s.length();
  vector<int> pi(n);
  for (int i = 1; i < n; ++i) {
    int j = pi[i - 1];
    while (j > 0 && s[i] != s[j]) j = pi[j - 1];
    if (s[i] == s[j]) ++j;
    pi[i] = j;
  }
  return pi;
}
vector<int> z_function(string s) {
  int n = (int)s.length();
  vector<int> z(n);
  for (int i = 1, l = 0, r = 0; i < n; ++i) {
    if (i <= r) z[i] = min(r - i + 1, z[i - l]);
    while (i + z[i] < n && s[z[i]] == s[i + z[i]]) ++z[i];
    if (i + z[i] - 1 > r) l = i, r = i + z[i] - 1;
  }
  return z;
}
vector<int> pl, pr;
int cmpL(int pos) {
  int f = pl[l.size() + 1 + pos];
  if (f >= l.size()) {
    return 0;
  }
  return a[pos + f] < l[f] ? -1 : 1;
}
int cmpR(int pos) {
  int f = pr[r.size() + 1 + pos];
  if (f >= r.size()) {
    return 0;
  }
  return a[pos + f] < r[f] ? -1 : 1;
}
int prefF[1010101];
int getSum(int l, int r) {
  if (l < 0) l = 0;
  if (l > r) return 0;
  int res = prefF[r];
  if (l != 0) res -= prefF[l - 1];
  if (res < 0) res += 998244353;
  return res;
}
int main() {
  cin >> a >> l >> r;
  pl = z_function(l + "#" + a);
  pr = z_function(r + "#" + a);
  dp[0] = 1;
  prefF[0] = 1;
  int ls = (int)l.size();
  int rs = (int)r.size();
  int as = (int)a.size();
  for (int i = 1; i <= as; ++i) {
    if (i >= ls) {
      if (ls == rs) {
        if (cmpL(i - ls) >= 0 && cmpR(i - ls) <= 0) {
          addmodfast(dp[i], dp[i - ls], 998244353);
        }
      } else {
        addmodfast(dp[i], getSum(i - (rs - 1), i - (ls + 1)), 998244353);
        if (cmpL(i - ls) >= 0) {
          addmodfast(dp[i], dp[i - ls], 998244353);
        }
        if (i >= rs && cmpR(i - rs) <= 0 && a[i - rs] != '0') {
          addmodfast(dp[i], dp[i - rs], 998244353);
        }
      }
    }
    prefF[i] = prefF[i - 1];
    if (a[i] != '0') {
      addmodfast(prefF[i], dp[i], 998244353);
    }
  }
  cout << dp[as] << endl;
  return 0;
}
