#include <bits/stdc++.h>
using namespace std;
int solve();
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  solve();
}
const int MOD = 998244353;
int HMOD;
int addm(int a, int b) {
  if (a + b >= MOD) return a + b - MOD;
  if (a + b < 0) return a + b + MOD;
  return a + b;
}
int add(int a, int b) {
  if (a + b >= HMOD) return a + b - HMOD;
  if (a + b < 0) return a + b + HMOD;
  return a + b;
}
int mul(int a, int b) { return ((long long)a * b) % HMOD; }
mt19937 mrand(time(0));
int solve() {
  vector<int> mds = {1000 * 1000 * 1000 + 7, 1000 * 1000 * 1000 + 9,
                     1000 * 1000 * 1000 + 21, 1000000033};
  HMOD = mds[mrand() & 3];
  int P = 300 + rand() % 10000;
  string s, sl, sr;
  cin >> s >> sl >> sr;
  int n = s.size();
  int lsz = sl.size();
  int rsz = sr.size();
  vector<pair<int, int> > a(n);
  for (int i = 0; i < n; ++i) {
    if (s[i] == '0') {
      if ((int)sl.size() == 1 && sl[0] == '0') {
        a[i] = make_pair(i, i);
      } else {
        a[i] = make_pair(-1, -1);
      }
    }
  }
  vector<int> p(n + 1);
  p[0] = 1;
  for (int i = 1; i <= n; ++i) {
    p[i] = mul(p[i - 1], P);
  }
  vector<int> h(n);
  h[0] = s[0];
  for (int i = 1; i < n; ++i) {
    h[i] = add(mul(h[i - 1], P), s[i]);
  }
  auto get_hash = [&](int l, int r) {
    int res = h[r];
    if (l) {
      res = add(res, -mul(p[r - l + 1], h[l - 1]));
    }
    return res;
  };
  vector<int> hl(lsz);
  hl[0] = sl[0];
  for (int i = 1; i < lsz; ++i) {
    hl[i] = add(mul(hl[i - 1], P), sl[i]);
  }
  vector<int> hr(rsz);
  hr[0] = sr[0];
  for (int i = 1; i < rsz; ++i) {
    hr[i] = add(mul(hr[i - 1], P), sr[i]);
  }
  auto checkl = [&](int pos) {
    int l = 0, r = sl.size() + 1;
    while (r - l > 1) {
      int mid = l + r >> 1;
      if (hl[mid - 1] == get_hash(pos, pos + mid - 1))
        l = mid;
      else
        r = mid;
    }
    if (l == sl.size()) return 1;
    return (int)(sl[l] <= s[pos + l]);
  };
  auto checkr = [&](int pos) {
    int l = 0, r = sr.size() + 1;
    while (r - l > 1) {
      int mid = l + r >> 1;
      if (hr[mid - 1] == get_hash(pos, pos + mid - 1))
        l = mid;
      else
        r = mid;
    }
    if (l == sr.size()) return 1;
    return (int)(sr[l] >= s[pos + l]);
  };
  for (int i = 0; i < n; ++i) {
    if (s[i] != '0') {
      int okl = 0;
      if (i + lsz <= n) {
        okl = checkl(i);
      }
      int okr = 1;
      if (i + rsz <= n) {
        okr = checkr(i);
      }
      if (i + lsz <= n) {
        int l = i + lsz - 1, r;
        if (!okl) l++;
        if (i + rsz <= n) {
          r = i + rsz - 1;
          if (!okr) --r;
        } else {
          r = n - 1;
        }
        if (l <= r) {
          a[i] = make_pair(l, r);
        } else
          a[i] = make_pair(-1, -1);
      }
    }
  }
  vector<int> dp(n);
  int cbal = 0;
  vector<int> sc(n + 1);
  if (a[0].first != -1) {
    sc[a[0].first] = addm(sc[a[0].first], 1);
    sc[a[0].second + 1] = addm(sc[a[0].second + 1], -1);
  }
  for (int i = 0; i < n; ++i) {
    if (i && a[i].first != -1) {
      int l = a[i].first;
      int r = a[i].second;
      sc[l] = addm(sc[l], dp[i - 1]);
      sc[r + 1] = addm(sc[r + 1], -dp[i - 1]);
    }
    cbal = addm(cbal, sc[i]);
    dp[i] = cbal;
  }
  printf("%d\n", dp[n - 1]);
  return 0;
}
