#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 6;
void getzfunc(char const *s, int n, int *z) {
  for (int i = 1, l = 0, r = 0; i < n; ++i) {
    z[i] = (i <= r) ? min(z[i - l], r - i + 1) : 0;
    while (i + z[i] < n && s[i + z[i]] == s[z[i]]) {
      ++z[i];
    }
    if (i + z[i] - 1 > r) {
      l = i;
      r = i + z[i] - 1;
    }
  }
}
const int mod = 998244353;
void add(int &x, int y) {
  x += y;
  if (x >= mod) x -= mod;
  return;
}
char s[N], a[N], b[N], in[N * 2];
int f[N], zfunc[N * 2];
bool low[N], high[N];
int main() {
  scanf("%s%s%s", s, a, b);
  int sz = strlen(s);
  int az = strlen(a);
  int bz = strlen(b);
  string inst = string(a) + "#" + string(s);
  int inz = inst.length();
  getzfunc(inst.data(), inz, zfunc);
  int *nxt = zfunc + az + 1;
  for (int i = 0; i < sz; ++i) {
    low[i] = (nxt[i] == az || a[nxt[i]] <= s[i + nxt[i]]);
  }
  inst = string(b) + "#" + string(s);
  inz = inst.length();
  getzfunc(inst.data(), inz, zfunc);
  nxt = zfunc + bz + 1;
  for (int i = 0; i < sz; ++i) {
    high[i] = (nxt[i] == bz || s[i + nxt[i]] <= b[nxt[i]]);
  }
  f[0] = 1;
  f[1] = mod - 1;
  for (int i = 0; i < sz; ++i) {
    int l = low[i] ? i + az : i + az + 1;
    int h = high[i] ? i + bz : i + bz - 1;
    if (s[i] == '0') h = i + 1;
    if (l <= h) {
      add(f[l], f[i]);
      if (h + 1 <= sz) add(f[h + 1], mod - f[i]);
    }
    add(f[i + 1], f[i]);
  }
  printf("%d\n", f[sz]);
  return 0;
}
