eolymp
bolt
Try our new interface for solving problems
Problems

Find the sum

Find the sum

Time limit 1 second
Memory limit 128 MiB

For the given three-digit number n find the sum of the three-digit numbers formed by all possible permutations of the digits of the number n, including the identical one.

Input data

Three-digit positive integer n.

Output data

Print the required sum.

Examples

Input example #1
123
Output example #1
1332
Author Matviychuk Sergiy
Source "ABC programming"