John's Test#7802

John's Test

1 second
64 megabytes
Very hard

Small John is testing numbers using two integers, and . For any integer , if A \leq X \leq B, then passes John's test. If not, John rearranges the digits of to form a new integer . He constructs by taking the first digit of , then the last digit, followed by the second digit, the second-to-last digit, and so on, until all digits are used. For instance, if X = 1234567, then Y = 1726354, and if X = 1020, then Y = 1002. If A \leq Y \leq B, then passes the test; otherwise, it does not.

Your task is to determine how many positive integers pass John's test.

Input

Two integers and , separated by a space.

Output

The count of positive integers that pass the test.

\Constraints

1 \leq A \leq B \leq 10^{18}

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading

Note

In the first example, the numbers , , , , , , and pass John's test.