Problems
Number of Permutations
Number of Permutations
Two distinct positive integers with decimal notations of the same length are called similar, if their decimal notations can be obtained from each other by permuting the digits.
How many numbers from the segment [l, r] have exactly one similar number in that segment?
Input
Contains two integer numbers l and r (1 ≤ l ≤ r ≤ 1015
).
Output
Print the required amount.
Input example #1
10 99
Output example #1
72