Number of Permutations#1926

Number of Permutations

2 seconds
256 megabytes
Very easy

Two positive integers with decimal representations of the same length are called similar if their decimal representations can be obtained from each other by permuting the digits.

How many numbers in the segment [l,\ r] have exactly one similar number in that segment?

Input

Contains two integers and (1 \le l \le r \le 10^{15}).

Output

Print the required amount.

Examples

Example 1

Loading
Loading