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

Source: codechef | Difficulty: UNKNOWN_DIFFICULTY


Solutions:
for _ in range(int(input())):
	s = input()
	c = 0
	for i in s:
		if i.isalpha() and i.isupper():
			c += 1
	print(c)


for _ in range(int(input())):
	str = input()
	c = 0
	for i in range(len(str)):
		if str[i] >= 'A' and str[i] <= 'J':
			c += 1
	print(c)


try:
	for _ in range(int(input())):
		q = input()
		print(10)
except:
	pass


try:
	l = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J']
	t = int(input())
	for i in range(t):
		x = list(input())
		x = [i for i in x if i in l]
		print(len(x))
except:
	pass


for _ in range(int(input())):
	n = input()
	al = 'ABCDEFGHIJ'
	a = max(n)
	print(al.index(a) + 1)


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)


t = int(input())
for _ in range(t):
	s = input()
	a = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J']
	enemy = 0
	for i in range(len(s)):
		if s[i] in a:
			enemy += 1
	print(enemy)


for _ in range(int(input())):
	s = input()
	p = 0
	for i in range(len(s)):
		if s[i] == 'A':
			p += 1
		elif s[i] == 'B':
			p += 1
		elif s[i] == 'C':
			p += 1
		elif s[i] == 'D':
			p += 1
		elif s[i] == 'E':
			p += 1
		elif s[i] == 'F':
			p += 1
		elif s[i] == 'G':
			p += 1
		elif s[i] == 'H':
			p += 1
		elif s[i] == 'I':
			p += 1
		elif s[i] == 'J':
			p += 1
	print(p)


for i in range(int(input())):
	s = input()
	print(10)


t = int(input())
for _ in range(t):
	print(10)


try:
	for i in range(int(input())):
		a = input()
		print(10)
except:
	pass


try:
	x = int(input())
	for _ in range(x):
		print(10)
except:
	pass


for _ in range(int(input())):
	s = input()
	se = set()
	ans = 0
	for i in s:
		se.add(i)
		ans += 1
		if len(se) == 10:
			break
	print(ans)


t = int(input())
while t > 0:
	lst = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J']
	n = input()
	op = 0
	for i in n:
		if i in lst:
			op += 1
	print(op)
	t -= 1


for _ in range(int(input())):
	coins = input()
	print(10)


for _ in range(int(input())):
	s = input()
	if len(s) > 10:
		print(10)
	else:
		print(len(s))


import sys
input = sys.stdin.readline
(inp, ip) = (lambda : int(input()), lambda : [int(w) for w in input().split()])
for _ in range(inp()):
	s = input().strip()
	dt = {}
	for i in s:
		dt[i] = dt.get(i, 0) + 1
	print(len(dt))


T = int(input())
while T > 0:
	s = str(input())
	T = T - 1
	L = list(s)
	Pa = L.index('A')
	Pb = L.index('B')
	Pc = L.index('C')
	Pd = L.index('D')
	Pe = L.index('E')
	Pf = L.index('F')
	Pg = L.index('G')
	Ph = L.index('H')
	Pi = L.index('I')
	Pj = L.index('J')
	List = [Pa, Pb, Pc, Pd, Pe, Pf, Pg, Ph, Pi, Pj]
	A = max(List)
	print(A + 1)


q = int(input())
for _ in range(q):
	arr = input()
	string = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J']
	cnt = 0
	for i in arr:
		if len(string) == 0:
			break
		try:
			string.remove(i)
		except:
			pass
		cnt += 1
	print(cnt)


T = int(input())
while T:
	l = input()
	n = len(l)
	if n >= 10:
		print(10)
	else:
		print(n)
	T -= 1


A = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J']
for _ in range(int(input())):
	s = input()
	l = []
	count = 0
	if len(s) == 0:
		print(0)
	else:
		for i in s:
			if i in A and i not in l:
				l.append(i)
				count += 1
		print(count)