Under construction

Still being built. Things may change

Three Dice

Interview

Time limit1sMemory limit128 MB

Summary
Given three dice values from 1 to 6, compute a prize following fixed rules for triples, pairs, or all different values.
Level

Easy2 of 10

Topics
Implementation
Solved
No attempts yet

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.

Examples3

  1. Example 1

    Input
    3 3 6
    
    Expected output
    1300
    
  2. Example 2

    Input
    2 2 2
    
    Expected output
    12000
    
  3. Example 3

    Input
    6 2 5
    
    Expected output
    600