#include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
unsigned long long h[3][1000005], p[1000005];
long long dp[1000005], s[1000005];
int q[2], n;
char lim[2][1000005], a[1000005];
unsigned long long _hash(int l, int r) {
  return h[0][r] - h[0][l - 1] * p[r - l + 1];
}
int cmp(int left, int right, int flag) {
  int len = right - left + 1, l = 0, r = len, mid = (l + r) >> 1, res;
  if (len < q[flag]) return -1;
  for (int i = 1; i < min(10, len); ++i) {
    if (a[left + i - 1] < lim[flag][i]) return -1;
    if (a[left + i - 1] > lim[flag][i]) return 1;
  }
  while (l <= r) {
    if (_hash(left, left + mid - 1) == h[flag + 1][mid])
      res = mid, l = mid + 1;
    else
      r = mid - 1;
    mid = (l + r) >> 1;
  }
  if (res == len) return 0;
  if (a[left + res] < lim[flag][res + 1]) return -1;
  return 1;
}
int main() {
  dp[0] = s[0] = p[0] = 1;
  for (int i = 1; i <= 1000000; ++i) p[i] = p[i - 1] * 131;
  scanf("%s %s %s", a + 1, lim[0] + 1, lim[1] + 1);
  n = strlen(a + 1), q[0] = strlen(lim[0] + 1), q[1] = strlen(lim[1] + 1);
  for (int i = 1; i <= n; ++i) h[0][i] = h[0][i - 1] * 131 + a[i];
  for (int i = 1; i <= q[0]; ++i) h[1][i] = h[1][i - 1] * 131 + lim[0][i];
  for (int i = 1; i <= q[1]; ++i) h[2][i] = h[2][i - 1] * 131 + lim[1][i];
  for (int i = 1; i <= n; ++i) {
    int l = max(i - q[1], 0), r = max(i - q[0], 0);
    if (cmp(l + 1, i, 1) > 0) ++l;
    if (cmp(r + 1, i, 0) < 0) --r;
    if (!l)
      dp[i] = s[r];
    else
      dp[i] = (s[r] - s[l - 1]) % MOD;
    if (i > 1 and a[i] == '0' and r == i - 1) dp[i] = (dp[i] + dp[i - 1]) % MOD;
    if (a[i + 1] == '0')
      s[i] = s[i - 1];
    else
      s[i] = (s[i - 1] + dp[i]) % MOD;
  }
  printf("%lld", (dp[n] + MOD) % MOD);
  return 0;
}
