luogu#P7797. [COCI 2015/2016 #6] BELA
[COCI 2015/2016 #6] BELA
Problem Description
There is a card game called . 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 has cards, and the trump suit is . Please compute the sum of the values of all of Mirko's cards.
Input Format
The first line contains an integer and a character .
In the next 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 , then this card is a trump card.
Output Format
Output one integer: the total value of all of Mirko's cards.
2 S
TH
9C
KS
QS
JS
TD
AD
JH
60
4 H
AH
KH
QH
JH
TH
9H
8H
7H
AS
KS
QS
JS
TS
9S
8S
7S
92
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 of the testdata, . 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 CONTEST #6 T1 BELA.
The score of this problem follows the original COCI problem setting, with a full score of .
Translated by ChatGPT 5