题目描述
Problem Description
Bessie's family is going out to eat tonight. The restaurant only serves three types of dishes, named A, B, and C.
The restaurant is running a discount campaign. If we say the consumption is at a $Y$ discount, it means the payment amount is $\dfrac{Y}{10}$ times the dish amount. Specifically, if dish B is purchased and dish C is not, the consumption is at an 80% discount; if dish C is purchased and dish B is not, the consumption is at a 70% discount; if both dishes B and C are purchased, the consumption is at a 60% discount.
This time, Bessie's family only orders two dishes. These two dishes may be the same. The dish amount is $x$ yuan. Given the names of the two dishes and $x$, please calculate the payment amount for Bessie's family.
Input Format
The input consists of two lines.
The first line contains an integer $x$, representing the dish amount for Bessie's family.
The second line contains two uppercase English letters $a$ and $b$, representing the names of the two dishes ordered by Bessie's family.
Output Format
The output consists of one line with one integer, representing the amount Bessie's family needs to pay after the discount.
Sample Input and Output
Sample Input #1
100
AB
Sample Output #1
80
Sample Input #2
100
CA
Sample Output #2
70
Notes
Sample 1 Explanation
If Bessie's family purchases dish B and does not purchase dish C, the entire consumption will be at an 80% discount. Before the discount, they need to pay $100$ yuan, so after the discount, they need to pay $100 \times 80\% = 80$ yuan.
Data Range and Constraints
For $100\%$ of the data, it is guaranteed that $10 \leq x \leq 10^{18}$ and $x$ is a multiple of $10$, and $a, b$ are one of the uppercase English letters A, B, C.
Note that we do not guarantee that $a$ and $b$ are necessarily different, which means it is possible for $a$ and $b$ to be the same.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分