In this task your friend K. will play 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.
Your friend K. has started playing bridge only recently, so he decided to practice counting 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 him and check!
The first line contains the integer n(1≤n≤104) from the task.
Each of the following n lines contains ki, a string consisting of characters ’A’,’K’,’Q’,’J’,’X’, of length 13, representing the cards your friend K. had in his hand after dealing them for the i-th time.
Print the required sum from the task.