#include <bits/stdc++.h>
using namespace std;
using lld = int64_t;
using llu = uint64_t;
using llf = long double;
using PII = pair<int, int>;
using PIL = pair<int, lld>;
using PLI = pair<lld, int>;
using PLL = pair<lld, lld>;
using PIB = pair<int, bool>;
using PBI = pair<bool, int>;
template <typename T>
using maxHeap = priority_queue<T, vector<T>, less<T>>;
template <typename T>
using minHeap = priority_queue<T, vector<T>, greater<T>>;
template <typename Iter>
ostream& _out(ostream& s, Iter b, Iter e) {
  s << "[";
  for (auto it = b; it != e; it++) s << (it == b ? "" : " ") << *it;
  s << "]";
  return s;
}
template <typename A, typename B>
ostream& operator<<(ostream& s, const pair<A, B>& p) {
  return s << "(" << p.first << "," << p.second << ")";
}
template <typename T>
ostream& operator<<(ostream& s, const vector<T>& c) {
  return _out(s, begin(c), end(c));
}
bool debug = 0;
template <typename T>
void DEBUG(const T& x) {
  if (debug) cerr << x;
}
template <typename T, typename... Args>
void DEBUG(const T& head, const Args&... tail) {
  if (debug) {
    cerr << head;
    DEBUG(tail...);
  }
}
const int N = 1000000 + 5;
const int qs[] = {
    1002939109, 1020288887, 1028798297, 1038684299, 1041211027, 1051762951,
    1058585963, 1063020809, 1094763083, 1106384353, 1120154459, 1140593173,
    1147930723, 1172520109, 1183835981, 1187659051, 1241251303, 1247184097,
    1255940849, 1272759031, 1287027493, 1288511629, 1294632499, 1312650799,
    1314753281, 1320080669, 1321970357, 1333133947, 1337684419, 1353508067,
    1358715989, 1364961029, 1366046831, 1376536367, 1381705499, 1410637769,
    1411311571, 1422795043, 1437499801, 1495803851, 1511764363, 1526710979,
    1538018089, 1542373769, 1545326953, 1549429633, 1556212739, 1575971759,
    1586465261, 1608336427, 1609783001, 1620728569, 1643267081, 1652401603,
    1656717203, 1660920671, 1666858577, 1669260361, 1670240317, 1678791131,
    1685583143, 1725964619, 1734856421, 1743134179, 1761537223, 1774260193,
    1778872889, 1781930609, 1803000149, 1814256623, 1834876331, 1839154463,
    1840044389, 1843241713, 1856039431, 1868564531, 1868732623, 1884198443,
    1884616807, 1885059541, 1909942399, 1914471137, 1923951707, 1925453197,
    1937719153, 1954649041, 1958915237, 1970709803, 1979612177, 1980446837,
    1989761941, 2007826547, 2008033571, 2011186739, 2039465081, 2039728567,
    2093735719, 2116097521, 2123852629, 2140170259};
const int ps[] = {
    179, 181, 191, 193, 197, 199, 211, 223, 227,  229,  233, 239, 241, 251, 257,
    263, 269, 271, 277, 281, 283, 293, 307, 311,  313,  317, 331, 337, 347, 349,
    353, 359, 367, 373, 379, 383, 389, 397, 401,  409,  419, 421, 431, 433, 439,
    443, 449, 457, 461, 463, 467, 479, 487, 491,  499,  503, 509, 521, 523, 541,
    547, 557, 563, 569, 571, 577, 587, 593, 599,  601,  739, 743, 751, 757, 761,
    769, 773, 787, 797, 809, 811, 821, 823, 827,  829,  839, 853, 857, 859, 863,
    947, 953, 967, 971, 977, 983, 991, 997, 1009, 1013,
};
class Hash {
 private:
  static int p, q;
  int sz, prefix[N];
  static int power[N];
  static inline int add(int x, int y) { return x + y >= q ? x + y - q : x + y; }
  static inline int sub(int x, int y) { return x - y < 0 ? x - y + q : x - y; }
  static inline int mul(int x, int y) {
    return static_cast<int>(1LL * x * y % q);
  }

 public:
  void init(const std::string& x) {
    if (p == -1) p = ps[rand() % 100];
    if (q == -1) q = qs[rand() % 100];
    sz = static_cast<int>(x.size());
    prefix[0] = 0;
    for (int i = 1; i <= sz; i++)
      prefix[i] = add(mul(prefix[i - 1], p), x[i - 1]);
    if (!power[0]) {
      power[0] = 1;
      for (int i = 1; i <= sz; i++) power[i] = mul(power[i - 1], p);
    }
  }
  int query(int l, int r) const {
    return sub(prefix[r], mul(prefix[l], power[r - l]));
  }
};
int Hash::p = -1, Hash::q = -1, Hash::power[];
const int MOD = 998244353;
inline int add(int x, int y) { return x + y >= MOD ? x + y - MOD : x + y; }
inline int sub(int x, int y) { return x - y < 0 ? x - y + MOD : x - y; }
inline int equal(int, int, const Hash&);
Hash hh, hl, hr;
int dp[N], podp[N];
int main(int argc, char* argv[]) {
  if (argc > 1 and string(argv[1]) == "-D") debug = 1;
  if (!debug) {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
  }
  srand(time(NULL) + clock() * 100);
  string base, L, R;
  cin >> base >> L >> R;
  hh.init(base);
  hl.init(L);
  hr.init(R);
  bool iszr = (L == "0");
  int n = ((int)((base).size()));
  dp[n] = podp[n] = 1;
  for (int i = n - 1; i >= 0; i--) {
    if (base[i] == '0') {
      dp[i] = iszr * dp[i + 1];
    } else {
      int lbound = -1, rbound = n;
      if (i + ((int)((R).size())) <= n) {
        int idx = equal(i, i + ((int)((R).size())), hr);
        rbound = i + ((int)((R).size()));
        if (idx < ((int)((R).size())) and base[i + idx] > R[idx]) rbound--;
      }
      if (i + ((int)((L).size())) <= n) {
        int idx = equal(i, i + ((int)((L).size())), hl);
        lbound = i + ((int)((L).size()));
        if (idx < ((int)((L).size())) and base[i + idx] < L[idx]) lbound++;
      }
      if (lbound != -1 and lbound <= n)
        dp[i] = sub(podp[lbound], podp[rbound + 1]);
    }
    podp[i] = add(dp[i], podp[i + 1]);
  }
  cout << dp[0] << '\n';
  return 0;
}
inline int equal(int l, int r, const Hash& h2) {
  int d = 0, u = r - l + 1;
  while (u - d > 1) {
    int m = (u + d) >> 1;
    if (hh.query(l, l + m) == h2.query(0, m))
      d = m;
    else
      u = m;
  }
  return d;
}
