Problem4521--促销骰子

4521: 促销骰子

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MiB

Description

小爱的商店正在促销。顾客在付款的时候,有机会掷一次骰子,如果掷出 lns="http://www.w3.org/1998/Math/MathML">6,可以获得优惠,并且可以继续掷骰子,直到出现不是 lns="http://www.w3.org/1998/Math/MathML">6 的情况,或掷三次为止。获奖规则如下:

  • 如果没有 lns="http://www.w3.org/1998/Math/MathML">6,没有优惠;
  • 如果只有一个 lns="http://www.w3.org/1998/Math/MathML">6,优惠 lns="http://www.w3.org/1998/Math/MathML">10 元;
  • 如果有两个 lns="http://www.w3.org/1998/Math/MathML">6,优惠 lns="http://www.w3.org/1998/Math/MathML">100 元;
  • 如果有三个 lns="http://www.w3.org/1998/Math/MathML">6,优惠 lns="http://www.w3.org/1998/Math/MathML">1000 元。

给定一组投掷的结果,请输出可以获得的优惠金额。

Input

输入由一个或多个整数构成。若存在多个数,则除最后一个数外,之前的数都是 lns="http://www.w3.org/1998/Math/MathML">6,且最多只有三个数。

Output

单个整数:表示获得的优惠金额。

Sample Input Copy

6 3

Sample Output Copy

10

Source/Category