题目描述
You are playing a game where you have been sent in a town to collect 10 types of coin and their symbol are defined with $A, B, C, D, E, F, G, H , I, J$. In that town every enemy have a coin. By killing one you will get a coin from that enemy. Each enemy have only a unique coin.
The challange of the game is You have to collect all the coin and only then you will get the victory. You are a brave gamer so you took this hard challange and successfully finished it. After finishing, you are thinking of the game. You know the order off collecting coin. Now you are thinking how many enemy did you have killed?
Can you solve that out?
-----Input:-----
First line of the input is an integer $T$.Next T line consists of a string which denotes the order of your collecting coins. The string consists of Uppercase latin latter only and from A to J.
-----Output:-----
Print T line, in each line an integer with the number of enemy you have killed in the operation.
-----Constraints-----
- $1 \leq T \leq 5000$
-----Sample Input:-----
1
ABCDEFGHIJ
-----Sample Output:-----
10
输入格式
见题面
输出格式
见题面