#2774

t = int(input())

for i in range(t):
	x = list(input())

	x = set(x)
	print(len(x))



7fe9b22ffeb41be0fead9d4fd96bbf7b5d025785
<mask token>

<mask token>
for i in range(t):
    x = list(input())
    x = set(x)
    print(len(x))

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

#2774

t = int(input())

for i in range(t):
	x = list(input())

	x = set(x)
	print(len(x))


