P7797 [COCI 2015/2016 #6] BELA
Description
There is a card game called $\text{Belote}$. The game uses only eight kinds of cards: `A`, `K`, `Q`, `J`, `T`, `9`, `8`, `7`.
The rules are to add up the values of all cards and compare who has the larger total value. Each kind of card has two possible values: one value when it is a **trump card**, and another value when it is a **non-trump card**. The values are shown in the table below:

Now $\text{Mirko}$ has $4 \times N$ cards, and the trump suit is $B$. Please compute the sum of the values of all of Mirko's cards.
Input Format
The first line contains an integer $N$ and a character $B$.
In the next $4 \times N$ lines, each line contains two characters. The first character is the rank of the card, and the second character is the suit of the card. If the suit of the card $= B$, then this card is a trump card.
Output Format
Output one integer: the total value of all of Mirko's cards.
Explanation/Hint
**[Sample 2 Explanation]**
The total value of the cards is $11 + 4 + 3 + 20 + 10 + 14 + 0 + 0 + 11 + 4 + 3 + 2 + 10 + 0 + 0 + 0 = 92$.
**[Constraints]**
For $100\%$ of the testdata, $1 \le N \le 100$. $B$ and the suits of all cards are one of `S`, `H`, `D`, `C`. The ranks of all cards are one of `A`, `K`, `Q`, `J`, `T`, `9`, `8`, `7`.
**[Source]**
**Translated from [COCI 2015-2016](https://hsin.hr/coci/archive/2015_2016/) [CONTEST #6](https://hsin.hr/coci/archive/2015_2016/contest6_tasks.pdf) T1 BELA**.
**The score of this problem follows the original COCI problem setting, with a full score of $50$**.
Translated by ChatGPT 5