#include <bits/stdc++.h>
using namespace std;
const int BigInt = 2000 * 1000 * 1000;
const int magic = 998244353;
const int maxl = 1001001;
vector<int> z_function(string s) {
  int n = (int)s.length();
  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 && s[z[i]] == s[i + z[i]]) ++z[i];
    if (i + z[i] - 1 > r) l = i, r = i + z[i] - 1;
  }
  return z;
}
struct RMQ {
  int l, r;
  RMQ *left, *right;
  long long res;
  long long intervalInc;
};
RMQ* build(long long* vs, int l, int r) {
  RMQ* res = new RMQ();
  res->l = l;
  res->r = r;
  res->intervalInc = 0;
  if (r - l >= 2) {
    int m = (l + r) / 2;
    res->left = build(vs, l, m);
    res->right = build(vs, m, r);
    res->res = res->left->res + res->right->res;
  } else {
    res->left = nullptr;
    res->right = nullptr;
    res->res = vs[l];
  }
  return res;
}
void increase(RMQ* q, int l, int r, int value) {
  if (q->r <= l || r <= q->l) return;
  if (l <= q->l && q->r <= r) {
    q->intervalInc = (q->intervalInc + value) % magic;
    return;
  }
  increase(q->left, l, r, value);
  increase(q->right, l, r, value);
}
int rmqGet(RMQ* q, int l, int r) {
  if (q->r <= l || r <= q->l) return 0;
  if (l <= q->l && q->r <= r)
    return (q->res + (q->r - q->l) * q->intervalInc) % magic;
  q->left->intervalInc = (q->left->intervalInc + q->intervalInc) % magic;
  q->right->intervalInc = (q->right->intervalInc + q->intervalInc) % magic;
  q->intervalInc = 0;
  return (rmqGet(q->left, l, r) + rmqGet(q->right, l, r)) % magic;
}
int rmqGet(RMQ* q, int v) { return rmqGet(q, v, v + 1); }
string a, l, r;
long long vs[maxl];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> a >> l >> r;
  bool lIsZero = l.length() == 1 && l[0] == '0';
  string l_a = l + "_" + a;
  string r_a = r + "_" + a;
  vector<int> zll = z_function(l_a);
  vector<int> zrr = z_function(r_a);
  vs[0] = 1;
  RMQ* rmq = build(vs, 0, a.length() + 1);
  for (int pos = 0; pos < a.length(); pos++) {
    if (a[pos] == '0') {
      if (lIsZero) increase(rmq, pos + 1, pos + 2, rmqGet(rmq, pos));
      continue;
    }
    int pl = zll[l.length() + 1 + pos];
    int pr = zrr[r.length() + 1 + pos];
    int l1 = 0;
    int r1 = 1;
    if (pl < l.length() && a[pos + pl] < l[pl]) l1 = 1;
    if (pr < r.length() && a[pos + pr] > r[pr]) r1 = 0;
    int minBound = pos + l.length() + l1;
    int maxBound = pos + r.length() + r1;
    increase(rmq, minBound, maxBound, rmqGet(rmq, pos));
  }
  cout << rmqGet(rmq, a.length()) << endl;
  return 0;
}
