Consider the sequence of all positive integers from to . Sort the digits of each number in increasing order. Find the sum of obtained numbers.
Two positive integers and .
Print the sum of obtained numbers.
Let . The numbers from to are: . After sorting the digits in these numbers we get: . Their sum equals to .