Numbers from digits#2323

Numbers from digits

1 second
128 megabytes
Very easy

A non-negative integer is given. Using all its digits, form the largest possible number, and then the smallest one. Print the sum of these two numbers.

For example, for n = 56002, the largest number is , and the smallest one is (leading zeros in the number are not considered). The required sum is 65200 + 256 = 65456.

Input

One integer (0 \leq n \leq 10^8).

Output

Print the sum of the largest and the smallest numbers that can be obtained from by rearranging its digits.

Examples

Example 1

Loading
Loading