Problem A
Seven Wonders
For example, if a player plays $3$ Tablet cards, $2$ Compass cards and $1$ Gear card, she gets $3^2 + 2^2 + 1^2 + 7 = 21$ points.
It might be tedious to calculate how many scientific points a player gets by the end of each game. Therefore, you are here to help write a program for the calculation to save everyone’s time.
Input
The input has a single string with no more than $50$ characters. The string contains only letters ‘T’, ‘C’ or ‘G’, which denote the scientific cards a player has played in a Seven Wonders game.
Output
Output the number of scientific points the player earns.
Note
Seven Wonders was created by Antoine Bauza, and published by Repos Production. Antoine Bauza and Repos Production do not endorse and have no involvement with the ProgNova contest.
Sample Input 1 | Sample Output 1 |
---|---|
TCGTTC |
21 |
Sample Input 2 | Sample Output 2 |
---|---|
CCC |
9 |
Sample Input 3 | Sample Output 3 |
---|---|
TTCCGG |
26 |