#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
inline int add(int a, int b) {
  a += b;
  if (a >= mod) a -= mod;
  return a;
}
inline int sub(int a, int b) {
  a -= b;
  if (a < 0) a += mod;
  return a;
}
inline int mul(int a, int b) { return (a * 1ll * b) % mod; }
inline int power(int a, int b) {
  int rt = 1;
  while (b > 0) {
    if (b & 1) rt = mul(rt, a);
    a = mul(a, a);
    b >>= 1;
  }
  return rt;
}
inline int inv(int a) { return power(a, mod - 2); }
const int N = 1e6 + 5;
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;
}
string a;
int mat[N][2], sum0[N], dp[N], sumdp[N];
void fill(string s, int ind) {
  string s1 = s + "$" + a;
  vector<int> v = z_function(s1);
  int n1 = s.size(), n = a.size();
  for (int i = 0; i < n; i++) mat[i][ind] = v[n1 + 1 + i];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout << setprecision(25);
  string l, r;
  cin >> a >> l >> r;
  int n = a.size(), l1 = l.size(), r1 = r.size();
  fill(l, 0);
  fill(r, 1);
  for (int i = 0; i < n; i++) {
    if (i + 1 < l1) continue;
    if (i > 0) sum0[i] = sum0[i - 1], sumdp[i] = sumdp[i - 1];
    if (a[i] == '0') sum0[i] = add(sum0[i], i - 1 < 0 ? 1 : dp[i - 1]);
    int ind1 = -1, ind2 = -1;
    ind1 = i - l1 + 1;
    int x = mat[ind1][0];
    if (x < l1 && a[ind1 + x] < l[x]) ind1--;
    if (ind1 < 0) continue;
    ind2 = i - r1 + 1;
    if (ind2 < 0)
      ind2 = 0;
    else {
      x = mat[ind2][1];
      if (x != r1 && a[ind2 + x] > r[x]) ind2++;
    }
    if (ind2 > ind1) continue;
    if (ind1 == ind2) {
      if (ind1 == 0)
        dp[i] = 1;
      else
        dp[i] = dp[ind1 - 1];
      if (i - ind1 > 0 && a[ind1] == '0') dp[i] = 0;
    } else {
      dp[i] = sub(sub(sumdp[ind1 - 1], (ind2 - 2 < 0 ? ind2 == 0 ? mod - 1 : 0
                                                     : sumdp[ind2 - 2])),
                  sub(sum0[ind1], (ind2 - 1 < 0 ? 0 : sum0[ind2 - 1])));
      if (i == ind1 && a[i] == '0') dp[i] = add(dp[i], i == 0 ? 1 : dp[i - 1]);
    }
    sumdp[i] = add(sumdp[i], dp[i]);
  }
  cout << dp[n - 1] << endl;
}
