cho.sh
Notes
Loading...

Three Dice

Time limit

1s

Memory limit

128 MB

Problem

A game uses three dice, each showing a value from 1 to 6. The prize is calculated by the following rules:

  1. If all three dice show the same value, the prize is 10,000 plus that value multiplied by 1,000.
  2. If exactly two dice show the same value, the prize is 1,000 plus the repeated value multiplied by 100.
  3. If all three dice show different values, the prize is the largest value multiplied by 100.

Given the three dice values, write a program that calculates the prize.

Input

The first line contains three integers separated by spaces. Each integer is between 1 and 6, inclusive.

Output

Print the calculated prize on the first line.