#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 10, MN = 2e6 + 10, MOD = 998244353;
string A, tmp_l, tmp_r;
int L[MN], R[MN], z[MN], dp[MN], ps[MN];
void fill_z(string s) {
  memset(z, 0, sizeof z);
  int cand = 0, pnt = 0;
  z[0] = ((int)(s).size());
  for (int i = 1; i < ((int)(s).size()); i++) {
    if (i > pnt || z[i - cand] >= pnt - i) {
      cand = i;
      if (i > pnt) pnt = i;
      z[cand] = pnt - cand;
      while (pnt < ((int)(s).size()) && s[z[cand]] == s[pnt]) z[cand]++, pnt++;
    } else
      z[i] = z[i - cand];
  }
}
void ok(int &x) {
  if (x >= MOD) x -= MOD;
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> A >> tmp_l >> tmp_r;
  fill_z(tmp_l + "#" + A);
  for (int i = 0; i < ((int)(A).size()); i++)
    L[i] = z[i + ((int)(tmp_l).size()) + 1];
  fill_z(tmp_r + "#" + A);
  for (int i = 0; i < ((int)(A).size()); i++)
    R[i] = z[i + ((int)(tmp_r).size()) + 1];
  dp[((int)(A).size())] = 1;
  ps[((int)(A).size())] = 1;
  for (int i = ((int)(A).size()) - 1; ~i; --i) {
    if (A[i] == '0') {
      if (tmp_l == "0")
        dp[i] = dp[i + 1];
      else
        dp[i] = 0;
      ps[i] = ps[i + 1] + dp[i];
      ok(ps[i]);
      continue;
    }
    if (tmp_r == "0") {
      dp[i] = 0;
    } else if (tmp_l == "0") {
      if (i + ((int)(tmp_r).size()) <= ((int)(A).size()) &&
          (R[i] == ((int)(tmp_r).size()) || A[i + R[i]] <= tmp_r[R[i]]))
        dp[i] = (ps[i + 1] - ps[i + ((int)(tmp_r).size()) + 1] + MOD);
      else
        dp[i] = (ps[i + 1] - ps[i + ((int)(tmp_r).size())] + MOD);
      ok(dp[i]);
    } else {
      int up = ((int)(tmp_r).size()) - 1;
      if (i + ((int)(tmp_r).size()) <= ((int)(A).size()) &&
          (R[i] == ((int)(tmp_r).size()) || A[i + R[i]] <= tmp_r[R[i]]))
        up = ((int)(tmp_r).size());
      int down = ((int)(tmp_l).size()) + 1;
      if (i + ((int)(tmp_l).size()) <= ((int)(A).size()) &&
          (L[i] == ((int)(tmp_l).size()) || A[i + L[i]] >= tmp_l[L[i]]))
        down = ((int)(tmp_l).size());
      if (down <= up) {
        dp[i] = (ps[i + down] - ps[i + up + 1] + MOD);
        ok(dp[i]);
      }
    }
    ps[i] = ps[i + 1] + dp[i];
    ok(ps[i]);
  }
  cout << dp[0] << '\n';
  return 0;
}
