You have initially a string of N characters, denoted by A1,A2...AN. You have to print the size of the largest subsequence of string A such that all the characters in that subsequence are distinct ie. no two characters in that subsequence should be same.

A subsequence of string A is a sequence that can be derived from A by deleting some elements  and without changing the order of the remaining elements.

-----Input-----
First line contains T, number of testcases. Each testcase consists of a single string in one line. Each character of the string will be a small alphabet(ie. 'a' to 'z').

-----Output-----
For each testcase, print the required answer in one line.

-----Constraints-----
- 1 ≤ T ≤ 10
- Subtask 1 (20 points):1 ≤ N ≤ 10
- Subtask 2 (80 points):1 ≤ N ≤ 105

-----Example-----
Input:
2
abc
aba

Output:
3
2

-----Explanation-----
For first testcase, the whole string is a subsequence which has all distinct characters.

In second testcase, the we can delete last or first 'a' to get the required subsequence.

Difficulty: interview

Starter code:

Solutions:
def solve(S):
 a = set(S)
 return len(a)
 
 
t = int(input())

for _ in range(t):
 s = input()
 print(solve(s))

# cook your dish her
for _ in range(int(input())):
 s = input()
 print(len(set(s)))

# cook your dish here
for test in range(int(input())):
 longest_distint_set = set(input())
 print(len(longest_distint_set))


# cook your dish here
t = 0 
try:
 t = int(input())
except:
 pass

for _ in range(t):
 a = input()
 
 print(len(set(a)))

from sys import stdin as sin
def aint():return int(input())
def amap():return map(int,sin.readline().split())
def alist():return list(map(int,sin.readline().split()))
def astr():return input()



for _ in range(int(input())):
 s=input()
 print(len(set(s)))

from sys import stdin as sin
def aint():return int(input())
def amap():return map(int,sin.readline().split())
def alist():return list(map(int,sin.readline().split()))
def astr():return input()



for _ in range(int(input())):
 s=input()
 f=[0]*26
 m=0
 for i in range(len(s)):
  if not f[ord(s[i])-97]:
   m+=1
   f[ord(s[i])-97]=1
   
 print(m)

t=int(input())
for _ in range(t):
 n=input()
 l1=[]
 for i in n:
  if i not in l1:
   l1.append(i)
 print(len(l1))

for _ in range(int(input())):
 N=input()
 l=[ ]
 for i in N:
  if i in l:
   pass
  else:
   l.append(i)
 print(len(l))

try:
 t = int(input())
 for w in range(t):
  s = str(input())
  k = list(s)
  q = []
  for i in range(0,len(k)):
   if (k[i] in k):
    if (k[i] not in q):
     q.append(k[i])
  
  print(len(q)) 
 
except EOFError as e:
 pass

for _ in range(int(input())):
 l=list(input())
 l2=[]
 for i in l:
  if i not in l2:
   l2.append(i)
 print(len(l2))

T = int(input())
ans = []

for _ in range(T):
 A = input()
 ans.append(len(set(list(A))))

for i in ans:
 print(i)


for _ in range(int(input())):
 s = set()
 for i in input():
  s.add(i)
 print(len(s))


for _ in range(int(input())):
 s=input()
 print(len(set(s)))

from math import ceil
for _ in range(int(input())):
 a=list(input())
 print(len(set(a)))
  


from math import ceil
for _ in range(int(input())):
 a=list(input())
 print(len(set(a)))
  


t=int(input())
for i in range(t):
 a=input()
 print(len(set(a)))
 


from collections import Counter
t=int(input())
for i in range(t):
 a=input()
 print(len(set(a)))
 


# cook your dish here
t=int(input())
for _ in range(t):
 arr=input()
 lis=[]
 for ele in arr:
  if ele not in lis:
   lis.append(ele)
 print(len(lis))
   
 


T = int(input())
for t in range(T):
 my_str = input()
 unique_list = []
 for ch in my_str:
  if ch not in unique_list:
   unique_list.append(ch)
 print(len(unique_list))

t=int(input())
for itr in range(t):
 s=input()
 print(len(set(s)))

import sys, os, io
def rs(): return sys.stdin.readline().rstrip()
def ri(): return int(sys.stdin.readline())
def ria(): return list(map(int, sys.stdin.readline().split()))
def ws(s): sys.stdout.write(s + '\n')
def wi(n): sys.stdout.write(str(n) + '\n')
def wia(a): sys.stdout.write(' '.join([str(x) for x in a]) + '\n')
from collections import defaultdict

for _ in range(int(input())):wi(len(set(rs())))

# cook your dish here
for _ in range(int(input())):
 s=input()
 a=set()
 for i in s:
  a.add(i)
 print(len(a))

for _ in range(int(input())):
 s = input()
 arr =[]
 for i in range(len(s)):
  if s[i] in arr:
   pass
  else:
   arr.append(s[i])
 print(len(arr))


for _ in range(int(input())):
 s = input()
 print(len(set(s)))