P7533 [COCI 2016/2017 #4] Bridge

Description

Mirko invented a card game. The cards only include $\text{A, K, Q, J}$ and $\text{X}$. Their scores are $4, 3, 2, 1, 0$, respectively. Given $N$ decks, each containing $13$ cards, find the total score of all cards in these $N$ decks.

Input Format

The first line contains an integer $N$. The next $N$ lines each contain a string $K_i$ of length $13$. The string only contains the characters $\text{A, K, Q, J, X}$.

Output Format

Output the total score of all cards.

Explanation/Hint

**[Sample 1 Explanation]** |Card Type|Number of Cards|Score per Card|Total Score| | :----------: | :----------: | :----------: | :----------: | |$\text{A}$|$4$|$4$|$4 \times 4=16$| |$\text{K}$|$2$|$3$|$2 \times 3=6$| |$\text{Q}$|$1$|$2$|$1 \times 2=2$| |$\text{J}$|$1$|$1$|$1 \times 1=1$| |$\text{X}$|$5$|$0$|$5 \times 0=0$| Therefore, the total score is $16+6+2+1+0=25$. **[Constraints]** For $100\%$ of the testdata, $1 \le N \le 10^4$. **[Notes]** **This problem is translated from [COCI 2016-2017](https://hsin.hr/coci/archive/2016_2017/) [CONTEST #4](https://hsin.hr/coci/archive/2016_2017/contest4_tasks.pdf) _T1 Bridž_.** **The scoring of this problem follows the original COCI problem settings, with a full score of $50$.** Translated by ChatGPT 5