Interesting Sum#2392

Interesting Sum

1 second
128 megabytes
Easy

Given a three-digit natural number . Find the sum of the largest and the smallest three-digit numbers that can be obtained by permuting the digits of .

Input

A natural number n~(100 \le n \le 999).

Output

Print the sum of the largest and the smallest three-digit numbers.

Examples

Example 1

Loading
Loading