#1273
Unrated
Bridž
시간 제한
1s
메모리 제한
32MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

After a few months of playing on his new phone, Mirko has finally decided to find a new hobby. He discovered a card game called bridge! It is known that bridge is played by four players using a 52-card deck, 4 suits total (clubs, hearts, diamonds and spades) and 13 values (A, K, Q, J, 10, 9, 8, 7, 6, 5, 4, 3 and 2). At the beginning of the game, each player is dealt 13 cards. Before starting the game, each player counts their so-called honor points in the following way: - each ace (A) is worth 4 points - each king (K) is worth 3 points - each queen (Q) is worth 2 points - each jack (J) is worth 1 point - the remaining cards (that will be denoted with X in this task) are worth 0 points. Given the fact that Mirko has started playing bridge only recently, he has decided to practice couting points. He dealt himself cards N times and each time counted his honor points. In the end, he added them up. He wants to know if he’s done a good job. Help Mirko and check!

입력

The first line of input contains the integer N (1 ≤ N ≤ 10 000) from the task. Each of the following N lines contains KiK_{i}, a string consisting of characters ‘A’, ‘K’, ‘Q’, ‘J’, ‘X’, of length 13, representing the cards Mirko had in his hand after dealing them for the i-th time.

출력

The first and only line of output must contain the required sum from the task.

예제 입력 1

1
AKXAKJXXXAXAQ

예제 출력 1

25

예제 입력 2

4
XXXAXXXXXXJXX
KXAXXXQJAXXXX
AQKQXXXKXXKQX
JXXXXXJXXXXXX

예제 출력 2

40
코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Unrated0명 투표
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.