#include <bits/stdc++.h>
using namespace std;
long long dp[1000010], sumdp[1000010];
string second, l, r;
vector<int> z, z1;
vector<int> z_function(string second) {
  int n = second.size();
  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 && second[z[i]] == second[i + z[i]]) ++z[i];
    if (i + z[i] - 1 > r) l = i, r = i + z[i] - 1;
  }
  return z;
}
char comp(int pos) {
  int pos1 = pos;
  pos = pos + l.size();
  int v = z[pos];
  if (v == (int)l.size())
    return ('=');
  else {
    if (l[v] < second[pos1 + v])
      return ('>');
    else
      return ('<');
  }
}
char comp1(int pos) {
  int pos1 = pos;
  pos = pos + r.size();
  int v = z1[pos];
  if (v == (int)r.size())
    return ('=');
  else {
    if (r[v] < second[pos1 + v])
      return ('>');
    else
      return ('<');
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> second >> l >> r;
  string p = l + '$' + second;
  string t = r + '$' + second;
  z = z_function(p);
  z1 = z_function(t);
  int n = second.size();
  second = " " + second;
  sumdp[n + 1] = 1;
  dp[n + 1] = 1;
  for (int i = n; i >= 1; i--) {
    if (second[i] == '0') {
      if (l == "0") dp[i] = dp[i + 1];
      sumdp[i] = sumdp[i + 1] + dp[i];
    } else {
      int x = (int)l.size() + 1;
      int y = (int)r.size() - 1;
      char a = comp(i);
      char b = comp1(i);
      if (a == '>' or a == '=') {
        x--;
      }
      if (b == '<' or b == '=') y++;
      if (x > y) continue;
      dp[i] = (sumdp[i + x] + 998244353 - sumdp[i + y + 1]) % 998244353;
      sumdp[i] = sumdp[i + 1] + dp[i];
      sumdp[i] %= 998244353;
    }
  }
  cout << dp[1] << '\n';
}
