#include <bits/stdc++.h>
long long dx[8] = {0, -1, 0, 1, 1, 1, -1, -1};
long long dy[8] = {1, 0, -1, 0, -1, 1, 1, -1};
using namespace std;
class pa3 {
 public:
  long long x, y, z;
  pa3(long long x = 0, long long y = 0, long long z = 0) : x(x), y(y), z(z) {}
  bool operator<(const pa3 &p) const {
    if (x != p.x) return x < p.x;
    if (y != p.y) return y < p.y;
    return z < p.z;
  }
  bool operator>(const pa3 &p) const {
    if (x != p.x) return x > p.x;
    if (y != p.y) return y > p.y;
    return z > p.z;
  }
  bool operator==(const pa3 &p) const {
    return x == p.x && y == p.y && z == p.z;
  }
  bool operator!=(const pa3 &p) const {
    return !(x == p.x && y == p.y && z == p.z);
  }
};
class pa4 {
 public:
  double x;
  long long y, z, w;
  pa4(double x = 0, long long y = 0, long long z = 0, long long w = 0)
      : x(x), y(y), z(z), w(w) {}
  bool operator<(const pa4 &p) const {
    if (x != p.x) return x < p.x;
    if (y != p.y) return y < p.y;
    if (z != p.z) return z < p.z;
    return w < p.w;
  }
  bool operator>(const pa4 &p) const {
    if (x != p.x) return x > p.x;
    if (y != p.y) return y > p.y;
    if (z != p.z) return z > p.z;
    return w > p.w;
  }
  bool operator==(const pa4 &p) const {
    return x == p.x && y == p.y && z == p.z && w == p.w;
  }
};
class pa2 {
 public:
  long long x, y;
  pa2(long long x = 0, long long y = 0) : x(x), y(y) {}
  pa2 operator+(pa2 p) { return pa2(x + p.x, y + p.y); }
  pa2 operator-(pa2 p) { return pa2(x - p.x, y - p.y); }
  bool operator<(const pa2 &p) const { return y != p.y ? y < p.y : x < p.x; }
  bool operator>(const pa2 &p) const { return x != p.x ? x < p.x : y < p.y; }
  bool operator==(const pa2 &p) const {
    return abs(x - p.x) == 0 && abs(y - p.y) == 0;
  }
  bool operator!=(const pa2 &p) const {
    return !(abs(x - p.x) == 0 && abs(y - p.y) == 0);
  }
};
string itos(long long i) {
  ostringstream s;
  s << i;
  return s.str();
}
long long gcd(long long v, long long b) {
  if (v > b) return gcd(b, v);
  if (v == b) return b;
  if (b % v == 0) return v;
  return gcd(v, b % v);
}
long long mod;
long long beki(long long wa, long long rr, long long warukazu) {
  if (rr == 0) return 1 % warukazu;
  if (rr == 1) return wa % warukazu;
  if (rr % 2 == 1) return (beki(wa, rr - 1, warukazu) * wa) % warukazu;
  long long zx = beki(wa, rr / 2, warukazu);
  return (zx * zx) % warukazu;
}
void zalgo(string s, long long *z) {
  long long n = s.length();
  z[0] = n;
  long long L = 0, R = 0;
  for (long long i = 1; i < n; i++) {
    if (i > R) {
      L = R = i;
      while (R < n && s[R - L] == s[R]) R++;
      z[i] = R - L;
      R--;
    } else {
      long long k = i - L;
      if (z[k] < R - i + 1)
        z[i] = z[k];
      else {
        L = i;
        while (R < n && s[R - L] == s[R]) R++;
        z[i] = R - L;
        R--;
      }
    }
  }
}
long long dp[1000020] = {0};
long long rui[1000020] = {0};
long long rui2[1000020] = {0};
long long d1[2000020] = {0};
long long d2[2000020] = {0};
long long ul, sl;
string ue, si, a;
bool chu(long long id) {
  if (a[id - 1] == '0') {
    if (ul == 1)
      return 1;
    else
      return 0;
  }
  if (d2[ul + id] >= ul) {
    return 1;
  }
  if (a[id - 1 + d2[ul + id]] >= ue[d2[ul + id]]) return 0;
  return 1;
}
bool chs(long long id) {
  if (a[id - 1] == '0') {
    if (si == "0")
      return 1;
    else
      return 0;
  }
  if (d1[sl + id] >= sl) {
    return 1;
  }
  if (a[id - 1 + d1[sl + id]] <= si[d1[sl + id]]) return 0;
  return 1;
}
long long dp2[1000200] = {0};
void hikaku(long long n) {
  for (long long i = 1; i <= n; i++) {
    for (long long j = max(0ll, i - ul); j <= i - sl; j++) {
      if (a[j] == '0') continue;
      long long g = stoi(a.substr(j, i - j));
      if (stoi(si) <= g && g <= stoi(ue)) {
        dp2[i] += dp2[j];
        dp2[i] %= mod;
      }
    }
  }
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  mod = 998244353;
  dp2[0] = 1;
  cin >> a >> si >> ue;
  sl = si.length();
  ul = ue.length();
  zalgo(si + "#" + a, d1);
  zalgo(ue + "#" + a, d2);
  dp[0] = 1;
  rui[0] = 1;
  rui2[0] = 1;
  long long n = a.length();
  for (long long i = 1; i <= n; i++) {
    if (sl > i) {
      rui2[i] = (rui2[i - 1]) % mod;
      continue;
    }
    long long hi, mi;
    if (sl < ul) {
      mi = i - sl - 1;
      hi = i - ul + 1;
      if (hi > 0 && mi >= 0) {
        dp[i] = (rui2[mi] - rui2[hi - 1] + mod) % mod;
      } else if (mi >= 0)
        dp[i] = (rui2[mi]) % mod;
      if (i - ul >= 0) {
        if (chu(i - ul + 1)) {
          dp[i] += dp[i - ul];
        }
      }
      if (chs(i - sl + 1)) {
        dp[i] += dp[i - sl];
      }
      dp[i] %= mod;
    } else {
      if (chu(i - ul + 1) && chs(i - ul + 1)) {
        hi = i - sl + 1;
        mi = hi;
      } else {
        hi = 3, mi = 1;
      }
      if (hi <= mi) {
        dp[i] = (dp[i - sl]) % mod;
      } else
        dp[i] = 0;
    }
    if (i == n) break;
    if (a[i] == '0')
      rui2[i] = rui2[i - 1];
    else
      rui2[i] = (rui2[i - 1] + dp[i]) % mod;
  }
  cout << dp[n] << endl;
  return 0;
}
