eolymp
bolt
Try our new interface for solving problems
Problems

Interesting Sum

Interesting Sum

Given a three-digit positive integer $n$. Find the sum of the largest and the smallest three-digit numbers that can be formed from a permutation of $n$ numbers. \InputFile One integer $n~(100 \le n \le 999)$. \OutputFile Print the sum of the largest and the smallest three-digit number.
Time limit 1 second
Memory limit 128 MiB
Input example #1
524
Output example #1
787