#arc153e. [arc153_e]Deque Minimization

[arc153_e]Deque Minimization

Problem Statement

For a positive integer XX none of whose digits is 00, consider obtaining a positive integer YY as follows.

  • Initialize SS as an empty string.
  • Let NN be the number of digits in XX. For i=1,ldots,Ni = 1, \\ldots, N in this order, do the following: insert the ii-th character in the decimal notation of XX at the beginning or end of SS.
  • Let YY be the positive integer represented by the string SS.

Let f(X)f(X) denote the minimum positive integer that can be obtained from XX in this way.


You are given a positive integer YY none of whose digits is 00. Print the number, modulo 998244353998244353, of positive integers XX none of whose digits is 00 such that f(X)=Yf(X) = Y.

Constraints

  • YY is a positive integer none of whose digits is 00.
  • 1leqY<102000001\\leq Y < 10^{200000}

Input

The input is given from Standard Input in the following format:

YY

Output

Print the number, modulo 998244353998244353, of positive integers XX none of whose digits is 00 such that f(X)=Yf(X) = Y.


Sample Input 1

1332

Sample Output 1

3

Three integers, 13321332, 31323132, and 33123312, satisfy the conditions.


Sample Input 2

3312

Sample Output 2

0

Sample Input 3

12234433442

Sample Output 3

153