Interesting Sum#823

Interesting Sum

1 second
128 megabytes
Very easy (≈850)

Given a three-digit positive integer . Find the sum of the largest and the smallest three-digit numbers that can be formed from a permutation of numbers.

Input

One integer n~(100 \le n \le 999).

Output

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

Examples

Example 1

Loading
Loading