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
# cook your dish here
t=int(input())
for i in range(t):
 s=input()
 ms=['A','B','C','D','E','F','G','H','I','J']
 ct=0
 i=0
 while ms!=[]: 
  if s[i] in ms:
   ind=ms.index(s[i])
   ms.pop(ind)
   ct+=1
  else:
   ct+=1
  i+=1
 print(ct)
# cook your dish here
t=int(input())
for i in range(t):
 s=input()
 ms=['A','B','C','D','E','F','G','H','I','J']
 ct=0
 i=0
 while ms!=[]: 
  if s[i] in ms:
   ind=ms.index(s[i])
   ms.pop(ind)
   ct+=1
  else:
   ct+=1
  i+=1
 print(ct)