Recently, Anton has found a set. The set consists of small English letters. Anton carefully wrote out all the letters from the set in one line, separated by a comma. He also added an opening curved bracket at the beginning of the line and a closing curved bracket at the end of the line. 

Unfortunately, from time to time Anton would forget writing some letter and write it again. He asks you to count the total number of distinct letters in his set.


-----Input-----

The first and the single line contains the set of letters. The length of the line doesn't exceed 1000. It is guaranteed that the line starts from an opening curved bracket and ends with a closing curved bracket. Between them, small English letters are listed, separated by a comma. Each comma is followed by a space.


-----Output-----

Print a single number — the number of distinct letters in Anton's set.


-----Examples-----
Input
{a, b, c}

Output
3

Input
{b, a, b, a}

Output
2

Input
{}

Output
0

Source: codeforces | Difficulty: EASY
Tags: Implementation

Constructive algorithms


Solutions:
letter_set_input = input()
actual_letter_set = set()
for char in letter_set_input:
	if char.isalpha():
		actual_letter_set.add(char)
print(len(actual_letter_set))


s = input()
se = set()
l = ['{', '}', ',', ' ']
for i in s:
	if i not in l:
		se.add(i)
print(len(se))


import atexit
import io
import sys
_INPUT_LINES = sys.stdin.read().splitlines()
input = iter(_INPUT_LINES).__next__
_OUTPUT_BUFFER = io.StringIO()
sys.stdout = _OUTPUT_BUFFER

@atexit.register
def write():
	sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
SET = set()
l = []
x = input()
a = len(x)
if a == 2:
	print('0')
else:
	l = x[1:a - 1].split(', ')
	x = len(l)
	for i in range(0, x):
		SET.add(l[i])
	print(len(SET))


a = input()
c = set()
for i in range(len(a)):
	if a[i] != '{' and a[i] != ',' and (a[i] != '}') and (a[i] != ' '):
		c.add(a[i])
print(len(c))


def Solve(s):
	check = []
	for i in range(1, len(s) - 1):
		if s[i] != ' ' and s[i] != ',':
			check.append(s[i])
	return len(set(check))
s = str(input())
print(Solve(s))


print(sum((1 for i in set(list(input())) if not i in '{, }')))


letter = input()
n = 0
for i in range(97, 123, 1):
	if str(chr(i)) in letter:
		n = n + 1
print(n)


n = set(input())
if ' ' in n and ',' in n and ('{' in n) and ('}' in n):
	print(len(n) - 4)
elif ' ' in n and '{' in n and ('}' in n):
	print(0)
elif '{' in n and ',' in n and ('}' in n):
	print(0)
elif '{' in n and '}' in n and (len(n) == 2):
	print(0)
else:
	print(1)


n = input()
k = ''
for i in n:
	if i not in '{}, ':
		k += i
b = 'qwertyuiopasdfghjklzxcvbnm'
c = 0
for i in b:
	if i in k:
		c += 1
print(c)


a = input()
s = set([])
for i in a:
	if i != '{' and i != '}' and (i != ' ') and (i != ','):
		s.add(i)
print(len(s))


s = input()
l = set()
for i in s:
	if 'a' <= i <= 'z':
		l.add(i)
print(len(l))


s = input().replace('{', '').replace('}', '').replace(', ', ' ')
s = set(list(s.split()))
print(len(s))


s = list(input())
un = ['{', '}', ' ', ',']
s = [ele for ele in s if ele not in un]
res = list(set(s))
print(len(res))


import re
line = input()
s = set(re.findall('[a-z]', line))
print(len(s))


i = input()
i = i.replace('{', '').replace('}', '')
i = i.split(', ')
aux = []
for j in i:
	if j not in aux:
		aux.append(j)
if aux == ['']:
	print(0)
else:
	print(len(aux))


s = input()
s = s[1:]
s = s[:len(s) - 1]
s = s.split(', ')
s = set(s)
s = list(s)
if '' in s:
	s.remove('')
print(len(s))


letters = input().replace('{', '').replace('}', '').split(', ')
letters = set(letters)
if letters == {''}:
	print(0)
else:
	print(len(letters))


letter = []
total = 0
string = input()
for i in string:
	if i.isalpha():
		if i not in letter:
			letter.append(i)
			total += 1
print(total)


x = input().strip(' ')
x = x.strip('{}')
x = x.strip(' ')
x = x.split(',')
x = list(map(lambda e: e.lstrip(), x))
x = list(map(lambda e: e.rstrip(), x))
x = list(set(x))
if x == ['']:
	print('0')
else:
	print(len(x))


s = input()
s = s[1:len(s) - 1]
k = list(map(str, s.split(', ')))
if k[0] == '':
	print(0)
else:
	print(len(set(k)))


l = input()[1:-1].split(', ')
if l[0] == '':
	print(0)
else:
	print(len(set(l)))


L = list(input())
M = []
a = int(len(L) / 3)
daima = [1 + 3 * i for i in range(0, a)]
for m in daima:
	M.append(L[m])
M = list(set(M))
print(len(M))


def main():
	letters = input()
	setOfLetters = set(map(str, letters.replace('{', '').replace('}', '').replace(', ', '')))
	print(len(setOfLetters))
main()


s = input()
s = s.replace(', ', '')
s = list(s)
del s[0]
del s[-1:]
print(len(set(s)))


enterede = input()
anse = 0
bunch = []
entered = list(enterede)
del entered[0]
del entered[len(entered) - 1]
for i in range(entered.count(',')):
	del entered[entered.index(',')]
for j in range(len(entered)):
	if entered[j] not in bunch and entered[j] != ' ':
		anse = anse + 1
		bunch.append(entered[j])
print(anse)


from collections import Counter
l = list(input())
c = Counter(l)
a = len(c)
if len(c) == 3:
	a = a - 2
elif len(c) == 2:
	a = a - 2
else:
	a = a - 4
print(a)


s = input()
if len(s) == 2:
	print(0)
else:
	s = s[1:-1]
	arr = s.split(', ')
	new = []
	for e in arr:
		if e in new:
			continue
		else:
			new.append(e)
	print(len(new))


s = input()[1:-1]
print(len(set(s.split(', '))) if s else 0)


test = input()
print(str(len({i for i in test[1:len(test) - 1].split(', ') if i != ''})))


def iindex(arr, item=0):
	ind = -1
	for (i, n) in enumerate(arr):
		if n == item:
			ind = i
	return ind
arr = input()[1:-1].split(', ')
if arr[0] == '':
	print(0)
	exit()
arr = set(arr)
print(len(arr))


a = input()
b = list(a)
c = []
if b[1] not in c and b[1] != '}':
	c.append(b[1])
for x in range(4, len(b), 3):
	if b[x] not in c:
		c.append(b[x])
print(len(c))


s = input()
x = 1
a = []
if s[x] == '}':
	print(0)
else:
	while x < len(s):
		a.append(s[x])
		x += 3
	b = []
	for i in a:
		if b.count(i) == 0:
			b.append(i)
	print(len(b))


a = []
a = input()
a = set(a)
new = []
for i in a:
	if i == ' ' or i == '{' or i == '}' or (i == ','):
		continue
	else:
		new.append(i)
print(len(new))


x = input()
lst = []
for i in x:
	if i != ',' and i != '{' and (i != '}') and (i != ' '):
		lst.append(i)
set = {i for i in lst}
print(len(set))


a = input()
b = []
s = ''
if a == '{}':
	print(0)
elif len(a) == 3:
	print(1)
else:
	for i in a:
		if i not in b:
			b.append(i)
	for i in b:
		s += i
	print(len(b) - 4)


print(len(set(input() + ', ')) - 4)


t = input()[1:-1]
print(len(set(t.split(', '))) if t else 0)


a = list(input())
a.remove('{')
a.remove('}')
a = set(a)
a = list(a)
if a.count(' ') == 1:
	a.remove(' ')
if a.count(',') == 1:
	a.remove(',')
print(len(a))


shuru = str(input())
shuru = shuru.lstrip('{')
shuru = shuru.rstrip('}')
shuru = shuru.replace(',', ' ')
l = [str(i) for i in shuru.split()]
sett = set(l)
print(len(sett))


n = input()
a = []
for i in range(len(n)):
	if n[i].isalpha() == 1:
		a.append(n[i])
print(len(list(set(a))))


k = input()
b = ''
for i in k:
	if i not in b and i not in ('{', '}', ',', ' '):
		b = b + i
print(len(b))


ip = input()
s = set()
for i in range(1, len(ip) - 1, 3):
	s.add(ip[i])
print(len(s))


l = input()[1:-1].split(', ')
if '' in l:
	l.remove('')
print(len(set(l)))


s = input()
l = []
for i in s:
	if i.isalpha():
		l.append(i)
print(len(set(l)))


a = input()
if a == '{}':
	print(0)
else:
	line = set()
	for t in a:
		if t.isalpha():
			line.add(t)
	x = len(line)
	print(x)


n = input()
n = n[1:len(n) - 1].split(', ')
s = set()
for i in n:
	if i != '':
		s.add(i)
print(len(s))


a = input()
a = ' '.join(a)
a = a.split()
b = len(a) - 2
a.remove(a[0])
a.remove(a[b])
a = ' '.join(a)
a = a.split(',')
a = ' '.join(a)
a = a.split()
c = []
for k in range(len(a)):
	letra = a[k]
	bol = 1
	for t in range(len(c)):
		if letra == c[t]:
			bol = 0
			break
	if bol == 1:
		c.append(letra)
	if len(c) == 26:
		break
print(len(c))


s = input()
l = []
for i in s:
	if 97 <= ord(i) <= 122:
		if i not in l:
			l.append(i)
print(len(l))


import math, fractions, collections, string
s = set([str(x) if x in string.ascii_lowercase else '' for x in input()])
print(len(s) - 1)


a = input()
l = list(set(a))
if '{' in l:
	l.remove('{')
if '}' in l:
	l.remove('}')
if ' ' in l:
	l.remove(' ')
if ',' in l:
	l.remove(',')
s = set(l)
print(len(s))


a = str(input())
b = []
if len(a) > 2:
	for i in range(1, len(a), 3):
		b.append(a[i])
c = list(set(b))
print(len(c))


s = input()
li = []
c = 0
for x in s:
	if x != '{' and x != '}' and (x != ',') and (x != ' '):
		if x not in li:
			li.append(x)
print(len(li))


import re as r
print(len(set(r.findall('([a-z]|[A-Z])', input()))))


string = input('')
if string == '{}':
	print(0)
else:
	string = string[1:len(string) - 1]
	string = string.split(', ')
	dt = dict()
	for i in range(len(string)):
		if string[i] in dt:
			dt[string[i]] = dt[string[i]] + 1
		else:
			dt[string[i]] = 1
	count = len(dt)
	print(count)


a = list(input())
b = []
for i in a:
	if i.isalpha():
		b.append(i)
print(len(set(b)))


s = input()[1:-1]
items = s.split(',')
lets = set()
for item in items:
	if item != '':
		lets.add(item.strip())
print(len(lets))


import re

def INT():
	return int(input())

def lis():
	return [int(x) for x in input().split()]

def S():
	return str(input())
se = S()
se = re.split(', |{|}', se)
se = set(se)
se.discard('')
print(len(se))


import re
s = input()
l = []
s = re.split('[{,} ]', s)
for i in range(len(s)):
	if s[i] != '':
		l.append(s[i])
print(len(set(l)))


n = list(input())
k = []
for i in range(0, len(n)):
	if 64 < ord(n[i]) < 91 or 96 < ord(n[i]) < 123:
		k.append(n[i])
k = set(k)
print(len(k))


a = input().strip('{} ,')
a = a.replace(',', '')
print(len(set(a.split())))


str = input()
print(f"{len({x for x in str if x >= 'a' and x <= 'z'})}")


a = input()
d = a[1:-1]
b = d.split(', ')
if len(a) == 2:
	print('0')
else:
	c = list(set(b))
	print(len(c))


import re
a = input()
if len(a) <= 2:
	print('0')
else:
	l = ['{', ',', '}', ' ']
	s = set()
	for l in a:
		if l.isalpha():
			s.add(l)
	print(len(s))


from collections import Counter
a = input()
k = Counter(a)
s = 0
for i in k:
	if i.isalpha() and k[i] >= 1:
		s += 1
print(s)


s = input().replace('}', '').replace('{', '').split(', ')
if s == ['']:
	print(0)
else:
	print(len(set(s)))


a = str(input())
b = []
c = ['{', '}', ',', ' ']
for i in a:
	if i not in c:
		b.append(i)
s = set(b)
print(len(s))


print(len({*input() + ' ,'}) - 4)


def fun(ss, i):
	if i == len(ss) - 1:
		return 0
	else:
		g = (ss[i] != ss[i + 1]) + fun(ss, i + 1)
		return g
a = input()
b = a[1:-1]
c = b[::3]
ss = ''.join(sorted(c))
if len(ss) < 2:
	print(len(ss))
else:
	x = 1 + fun(ss, 0)
	print(x)


s = input()
li1 = []
for i in s:
	if ord(i) > 96 and ord(i) < 123:
		if i not in li1:
			li1.append(i)
print(len(li1))


n = input()
c = 0
s = ''
for i in n:
	if i.isalpha():
		if not i in s:
			s += i
			c += 1
print(c)


while True:
	try:
		line = input()
		line = line.strip('{')
		line = line.strip('}')
		line = line.replace(',', '')
		line = line.split()
		line_set = set(line)
		print(len(line_set))
	except EOFError:
		break


x = input()
data = set()
for i in range(len(x)):
	if x[i].isalpha():
		data.add(x[i])
print(len(data))


data = input()
counts = dict()
for i in data:
	if i.isalpha():
		counts[i] = counts.get(i, 0) + 1
print(len(counts))


a = input()
D = {}
count = 0
for i in a:
	if i == '}' or i == '{' or i == ' ' or (i == ','):
		pass
	elif i in D:
		D[i] += 1
	else:
		count += 1
		D[i] = 1
print(count)


import string
line = input()
sum = 0
d = dict.fromkeys(string.ascii_lowercase, 0)
for l in line:
	if l.isalpha():
		d[l] += 1
for m in string.ascii_lowercase:
	if d[m] > 0:
		sum += 1
print(sum)


x = input()
if len(x) > 2:
	print(len(set(x[1::3])))
else:
	print(0)


def _443A(letters):
	if letters == ['']:
		return 0
	return len(list(set(letters)))
letters = list(map(lambda x: x.strip(), input()[1:-1].split(',')))
print(_443A(letters))


inputStr = input()
inputStr = inputStr.replace('{', '')
inputStr = inputStr.replace('}', '')
inputStr = inputStr.replace(' ', '')
letters = inputStr.split(',')
temp = []
for letter in letters:
	if letter not in temp and letter != '':
		temp.append(letter)
print(len(temp))


print(len(set((x for x in input().replace('}', ',').replace('{', '').replace(' ', '').split(',')))) - 1)


s = input()
s = s[1:len(s) - 1]
if len(s) == 0:
	print(len(s))
else:
	l = list(s.split(','))
	for i in range(0, len(l)):
		l[i] = l[i].lstrip()
	print(len(dict.fromkeys(l)))


s = input()
if len(s) == 2:
	print(0)
else:
	s = s.replace('{', '')
	s = s.replace('}', '')
	l = s.split(', ')
	s = set(l)
	print(len(s))


bakko = input()
ditio_bakko = bakko.replace('{', '')
ditio_bakko = ditio_bakko.replace('}', '')
ditio_bakko = ditio_bakko.replace(' ', '')
ditio_bakko = ditio_bakko.replace(',', '')
print(len(set(ditio_bakko)))


s = str(input())
res = set()
for i in range(len(s)):
	if s[i] >= 'a' and s[i] <= 'z':
		res.add(s[i])
print(len(res))


s = input()
letters = set()
for x in s:
	if x != '{' and x != '}' and (x != ',') and (x != ' '):
		letters.add(x)
print(len(letters))


ch = input().replace(',', '')
ch = ch[1:-1]
ch = set(ch.split())
print(len(ch))


n = input()
a = ''
n = n[1:-1]
for i in n:
	if i == ' ' or i == ',':
		continue
	else:
		a += i
from collections import Counter
if len(a) == 0:
	print('0')
else:
	print(len(Counter(a)))


s = input().strip('{').strip('}').split(',')
letters = set()
for c in s:
	if c.strip() != '':
		letters.add(c.strip())
print(len(letters))


str = []
for i in range(26):
	str.append(0)
x = input()
for i in x:
	if i >= 'a' and i <= 'z':
		str[ord(i) - 97] = 1
m = 0
for i in str:
	m += i
print(m)


from sys import stdin
l = stdin.readline().rstrip()[1:-1].split(', ')
if l == ['']:
	print(0)
else:
	print(len(set(l)))


x = input()
y = list(x)
p = []
c = 0
for n in range(1, len(y) - 1, 3):
	if y[n] not in p:
		p.append(y[n])
		c = c + 1
	elif y[n] in p:
		c = c
print(c)


s = input()
l = []
for i in s:
	if ord(i) >= 97 and ord(i) <= 122:
		l.append(i)
l = set(l)
print(len(l))


s = set(input())
if len(s) in [2, 3]:
	print(len(s) - 2)
else:
	print(len(s) - 4)


a = list(input())
a.pop(0)
a.pop(len(a) - 1)
while ',' in a:
	a.remove(',')
while ' ' in a:
	a.remove(' ')
print(len(set(a)))


n = input().strip('{').strip('}').split(', ')
if n == ['']:
	print(0)
else:
	print(len(set(n)))


l = input()
a = []
for i in l:
	if i in 'abcdefghijklmnopqrstuvwxyz' and i not in a:
		a.append(i)
print(len(a))


n = set(list(input()))
k = 0
for i in n:
	if i.isalpha():
		k += 1
print(k)


a = input()
b = set(a)
ans = 0
if len(b) <= 3:
	print(len(b) - 2)
else:
	print(len(b) - 4)


s = input().replace('{', ', ').replace('}', ', ').split(', ')
r = list()
for i in s:
	if i != '' and i not in r:
		r.append(i)
print(len(r))


def aletters(s):
	filtered = [x for x in list(s) if x != '{' and x != ',' and (x != ' ') and (x != '}')]
	return len(set(filtered))
s = input().strip()
print(aletters(s))


letters = input()
letters = letters.replace('{', '')
letters = letters.replace('}', '')
letters = letters.replace(', ', '')
set_letters = set()
for letter in letters:
	set_letters.add(letter)
print(len(set_letters))


a = list(input())
c = 0
a = list(dict.fromkeys(a))
for i in range(len(a)):
	if a[i] >= 'a' and a[i] <= 'z':
		c += 1
print(c)


set1 = input()
set2 = set()
for ele in set1:
	if ele >= 'a' and ele <= 'z':
		set2.add(ele)
print(len(set2))


import re
a = str(input())
c = ['', '{', ',', ' ', ',', '', '']
b = re.split('|\\{,|\\}', a)
for i in range(len(a)):
	if b[i] not in c:
		c.append(b[i])
print(len(c) - 7)
c.clear()


s = input()
i = 1
a = []
if len(s) == 2:
	print(0)
	exit(0)
while i < len(s):
	a.append(int(ord(s[i])))
	i = i + 3
a.sort()
ans = 0
for i in range(len(a)):
	if i == 0 or a[i] != a[i - 1]:
		ans = ans + 1
print(ans)


s = input()
se = set()
for i in s:
	if i.isalpha():
		se.add(i)
print(len(se))


def anton_and_letters():
	inp = input()
	letters = [l for l in inp[1:len(inp) - 1].split(', ') if l]
	letter_set = set()
	for letter in letters:
		if letter not in letter_set:
			letter_set.add(letter)
	return len(letter_set)
print(anton_and_letters())


s = input()
if len(s) == 2 or len(s) == 3:
	print(len(set(s)) - 2)
else:
	print(len(set(s)) - 4)


from sys import stdin, stdout
a = stdin.readline().strip()
lis = []
for each in a:
	if each not in lis and each != '}' and (each != '{') and (each != ',') and (each != ' '):
		lis.append(each)
print(len(lis))


s = input()
l = []
k = 0
for i in [chr(x) for x in range(97, 123)]:
	l.append(s.count(i))
for i in range(len(l)):
	if int(l[i]) != 0:
		k = k + 1
print(k)


s = str(input())
c = 0
t = set()
for i in range(len(s)):
	if ord(s[i]) >= 97 and ord(s[i]) <= 122:
		t.add(s[i])
print(len(t))


s = input()
c = str()
for i in s:
	if i.isalpha():
		c = c + i
print(len(set(c)))


n = input()[1:-1]
a = set(n.split(', '))
if n == '':
	print(0)
else:
	print(len(a))


a = str(input())
n = set(a)
if len(n) <= 2:
	print(0)
if len(n) == 3:
	print(1)
if len(n) >= 4:
	n.remove('{')
	n.remove('}')
	n.remove(',')
	n.remove(' ')
	print(len(n))


def main():
	s = input()
	ss = set(s)
	ss.remove('{')
	ss.remove('}')
	if ' ' in ss:
		ss.remove(' ')
	if ',' in ss:
		ss.remove(',')
	print(len(ss))
main()


line = input()[1::3]
unique = []
uCount = 0
for letter in line:
	if letter not in unique and letter is not '}':
		uCount += 1
		unique.append(letter)
print(uCount)


list = [str(x) for x in input().split()]
list2 = []
count = 0
for i in list:
	for j in i:
		list2.append(j)
list2 = set(list2)
for i in list2:
	if ord(i) > 96 and ord(i) < 123:
		count = count + 1
print(count)


x = input()
y = x[1:-1]
list = y.split(', ')
if list == ['']:
	print(0)
else:
	final = []
	for a in list:
		if a not in final:
			final.append(a)
	print(len(final))


rmv = ['{', '}', ' ', ',']
str = input()
for i in rmv:
	str = str.replace(i, '')
str = set(str)
print(len(str))


a = input()
b = len(set(map(str, a[1:-1].split(', '))))
if len(a) == 2:
	print('0')
else:
	print(b)


s = input()
lst = []
for i in range(len(s)):
	lst.append(s[i])
lst.pop(0)
lst.pop(-1)
lst1 = []
for i in range(len(lst)):
	if lst[i] != ',' and lst[i] != ' ':
		lst1.append(lst[i])
lst1 = set(lst1)
print(len(lst1))


str1 = input().strip()[1:-1].split(',')
check = set()
for c in str1:
	if len(c.strip()):
		check.add(c.strip())
print(len(list(check)))


s = input()
T = []
track = []
for i in s:
	if i != '{' and i != '}' and (i != ',') and (i != ' '):
		T.append(i)
for i in range(len(T)):
	if T[i] in track:
		continue
	else:
		track.append(T[i])
print(len(track))


d = set(input())
count = 0
if ',' in d:
	count += 1
if ' ' in d:
	count += 1
print(len(d) - (count + 2))


set1 = input()
set1 = set1.replace('{', '')
set1 = set1.replace('}', '')
if set1 == '':
	numbers = []
else:
	numbers = set1.split(', ')
letters = set(numbers)
print(len(letters))


h = list(input())
h = set(h)
n = len(h)
if len(h) == 2:
	print(0)
elif len(h) == 3:
	print(1)
else:
	print(n - 4)


x = input()
y = x[1:-1].split(', ')
count = 0
if len(y) == 1 and y[0] == '':
	print(0)
else:
	for a in range(len(y)):
		if y[a] not in y[a + 1:]:
			count += 1
	print(count)


n = input()
k = set()
for i in n:
	if ord(i) >= 97 and ord(i) <= 122:
		k.add(i)
print(len(k))


x = [ord(i) for i in input()]
y = list(set([chr(i) for i in x if 97 <= i <= 122]))
print(len(y))


q = input()[1:-1].split(', ')
print([len(set(q)), 0][{''} == set(q)])


import re
letters = input()
x = re.findall('[a-z]', letters)
x = set(x)
l = len(x)
print(l)


t = input()
exi = []
for i in t:
	if i not in exi and i != ',' and (i != ' ') and (i != '{') and (i != '}'):
		exi.append(i)
print(len(exi))


def my_function(x):
	return list(dict.fromkeys(x))
s = input()
l = []
if len(s) == 2:
	print('0')
else:
	for i in range(1, len(s), 3):
		l.append(s[i])
	print(len(my_function(l)))


s = input()
l = s[1:-1].split(', ')
if len(s) == 2:
	print(0)
else:
	print(len(set(l)))


s = input()
l = s[1:-1]
l = l.replace(', ', '')
print(len(set(l)))


s = input()
if s == '{}':
	print(0)
else:
	s = s.rstrip('}')
	s = s.lstrip('{')
	s = s.split(', ')
	print(len(set(s)))


str = set(input() + ', ')
print(len(str) - 4)


s = ''
s = input().strip('{}')
s = s.replace(',', '')
s = s.replace(' ', '')
s = set(s)
print(len(s))


s = input()
diff = set()
for c in s:
	if 'a' <= c <= 'z':
		diff.add(c)
print(len(diff))


x = input()
x = x.replace(' ', '')
x = x.replace("'", '')
x = x.replace(',', '')
x = x.replace('{', '')
x = x.replace('}', '')
x = sorted(x)
y = ''
i = 0
if len(x) > 0:
	while i < len(x) - 1:
		if not x[i] == x[i + 1]:
			y = y + x[i]
		i += 1
	y = y + x[i - 1]
	print(len(y))
else:
	print(0)


sent = input()
line = sent[1:]
line = line[:-1]
list = []
for letter in line:
	if letter != ',' and letter != ' ':
		list.append(letter)
s = []
for item in list:
	if item not in s:
		s.append(item)
print(len(s))


arr = input()
l1 = []
for i in range(1, len(arr) - 1, 3):
	l1.append(arr[i])
print(len(set(l1)))


print(len({c for c in input() if ord(c) > 64 and ord(c) < 123}))


s = list(input())
s.remove('{')
s.remove('}')
s = ''.join(s)
s = set(s.split(', '))
s = [x for x in s if x]
print(len(s))


s = input()
dict = set()
for i in range(len(s)):
	if s[i] == '{' or s[i] == '}' or s[i] == ',' or (s[i] == ' '):
		pass
	else:
		dict.add(s[i])
print(len(dict))


n = input()
arr = []
for i in n:
	if i != '{' and i != '}' and (i != ',') and (i != ' '):
		arr.append(i)
print(len(set(arr)))


st = input()
temp = ''
for i in st:
	if i.isalpha() and i not in temp:
		temp = temp + i
print(len(temp))


n = input('')
dic = dict()
for i in n:
	if i != '{' and i != '}' and (i != ',') and (i != ' '):
		if i not in dic:
			dic[i] = 1
le = len(dic)
print(le)


s = input()
count = 0
if s == '{}':
	print(0)
else:
	s = set(s)
	for i in s:
		if i.isalpha():
			count += 1
	print(count)


l = input()
k = list(set(l))
c = 0
for i in k:
	if ord(i) >= 97 and ord(i) <= 122:
		c += 1
print(c)


print(len(set(input()[1:-1].replace(',', '').replace(' ', ''))))


s = input()
l = []
for i in range(len(s)):
	if s[i] != ' ' and s[i] != ',':
		l.append(s[i])
n = len(l)
del l[n - 1]
del l[0]
f = set(l)
print(len(f))


a = set(input())
if len(a) >= 4:
	print(len(a) - 4)
else:
	print(len(a) - 2)


ls = list(input())
d = list(dict.fromkeys(ls))
if len(d) == 2:
	print(0)
elif len(d) == 3:
	print(1)
else:
	print(len(d) - 4)


a = input()
a = a + ', '
a = set(a)
n = len(a)
print(n - 4)


s = input()
letters = set()
for i in s:
	if i.isalpha():
		letters.add(i)
print(len(letters))


s = input()
lis = []
for i in range(len(s)):
	if s[i].isalpha():
		lis.append(s[i])
lis = set(lis)
print(len(lis))


print(len([_ for _ in set(input()[1:-1].split(', ')) if _]))


import re
a = re.sub('[^A-Za-z]', ' ', input()).split()
s = set()
s.update(a)
print(len(s))


a = input()
b = list(a)
c = []
for i in b:
	if 96 < ord(i) < 123 and i not in c:
		c.append(i)
print(len(c))


import sys

class Scanner:

	def __init__(self):
		self.current_tokens = []

	def remaining_tokens(self):
		return len(self.current_tokens)

	def nextline(self):
		assert self.remaining_tokens() == 0, 'Reading next line with remaining tokens'
		return input()

	def nexttokens(self):
		return self.nextline().split()

	def nexttoken(self):
		if len(self.current_tokens) == 0:
			self.current_tokens = self.nexttokens()
		assert self.remaining_tokens() > 0, 'Not enough tokens to parse.'
		return self.current_tokens.pop(0)

	def nextints(self, n=-1):
		if n == -1:
			return list(map(int, self.nexttokens()))
		else:
			return (self.nextint() for i in range(n))

	def nextint(self):
		return int(self.nexttoken())

def quit():
	sys.exit(0)
stdin = Scanner()
nextint = stdin.nextint
nextints = stdin.nextints
nextline = stdin.nextline
sp = nextline()[1:-1].split(', ')
b = set()
for s in sp:
	if len(s) > 0:
		b.add(s)
print(len(b))


a = input()
b = []
for i in range(1, len(a), 3):
	b.append(a[i])
if len(a) < 3:
	print(0)
else:
	print(len(set(b)))


import re
A = []
a = 0
B = input()[1:-1]
if len(B) != 0:
	C = re.findall('[ ](.*?)[,]', B)
	D = list(B)
	C.append(D[-1])
	C.append(D[0])
	B = C
	for x in B:
		if x not in A:
			A.append(x)
			a = a + 1
	print(a)
else:
	print(0)


s = input()
a = 0
if ',' in s:
	a = 2
print(len(set(s)) - 2 - a)


a = input()
c = []
b = ['{', '}', ',', ' ']
for i in range(len(a)):
	if a[i] not in b:
		c.append(a[i])
print(len(set(c)))


letters = input()
if letters == '{}':
	print(0)
else:
	line = set()
	for i in letters:
		if i.isalpha():
			line.add(i)
	length = len(line)
	print(length)


sp = list(input())
sp = sp[1:len(sp) - 1]
while ',' in sp:
	sp.remove(',')
while ' ' in sp:
	sp.remove(' ')
sp = set(sp)
print(len(sp))


st = input()
if st == '{}':
	print(0)
else:
	print(len(set(st.lstrip('{').rstrip('}').split(', '))))


raw = input()
n = len(raw)
if n <= 2:
	print('0')
elif n == 3:
	print('1')
else:
	print(len(set(raw[1:n - 1].split(', '))))


x = input()
y = list(x)
for i in y:
	if i == '}' or i == '{' or i == ',':
		y.remove(i)
while ' ' in y:
	y.remove(' ')
if y[0] == 'w' and y[2] == 'r':
	print('26')
else:
	for i in y:
		while y.count(i) > 1 or y.count('}') >= 1 or y.count('{') >= 1:
			y.remove(i)
	print(len(y))


line = input()
line = line[1:]
line = line[:-1]
mn = set()
line = line.split(', ')
for item in line:
	if item != '':
		mn.add(item)
print(len(mn))


str1 = input()
str2 = str1[1:-1]
str3 = str2.split(', ')
a = set(str3)
if len(str1) == 2:
	print(0)
else:
	print(len(a))


string = input()
distinct = len(set([i for i in string if i.isalpha()]))
print(distinct)


_set = set(input().replace('{', '').replace('}', '').replace(',', '').split())
print(len(_set))


s = input()
s_set = set(s)
if len(s_set) == 2:
	print(0)
elif len(s_set) == 3:
	print(1)
else:
	print(len(s_set) - 4)


a = {x for x in input() + ', '}
print(len(a) - 4)


def solve():
	s = input()[1:-1]
	if len(s) == 0:
		return 0
	p = set(s.split(', '))
	return len(p)
print(solve())


i = input()[1:-1].split(', ')
l = []
for j in i:
	if j not in l and j != '':
		l.append(j)
	else:
		pass
print(len(l))


def dist(s):
	s = set(s) - {'{', '}', ',', ' '}
	return len(s)
print(dist(input()))


a = input()
m = list()
for e in a:
	if ord(e) > 96 and ord(e) < 123:
		if e not in m:
			m.append(e)
print(len(m))


s = input()
s = s[1:]
s = s[:len(s) - 1]
s = s.replace(',', '')
s = s.split()
print(len(set(s)))


l = list(map(str, input().split(', ')))
d = []
d.append(l[0][1:])
for i in range(1, len(l) - 1):
	d.append(l[i])
d.append(l[len(l) - 1][:1])
if '{' in d:
	d.remove('{')
if '}' in d:
	d.remove('}')
print(len(set(d)))


s = input()
if s == '{}':
	print(0)
else:
	z = s[1:len(s) - 1]
	k = set(z.split(', '))
	print(len(k))


st = input().strip('{}').split(', ')
x = set(st)
count = 0
for i in x:
	if i != '':
		count += 1
print(count)


i = input()
i = i[1:-1]
b = set(i.split(', '))
if b == {''}:
	print(0)
else:
	print(len(b))


s = input()
z = []
for i in s:
	if i not in ' ,{}':
		if i not in z:
			z.append(i)
print(len(z))


k = len(set(str(input())))
if k > 3:
	print(k - 4)
elif k == 2:
	print('0')
else:
	print('1')


import string
s = list(''.join(input().split(', ')))
s = s[1:len(s) - 1]
count = 0
letter_count = dict(((key, 0) for key in string.ascii_lowercase))
for i in range(len(s)):
	letter_count[s[i]] += 1
for k in letter_count:
	if letter_count[k] > 0:
		count += 1
print(count)


a = input()
i = 1
c = []
while i < len(a) - 1:
	while a[i] != ',' and a[i] != ' ' and (i < len(a) - 1):
		c.append(a[i])
		i += 1
	i += 1
c = set(c)
print(len(c))


s = list(input().strip())
del s[0]
del s[-1]
s = set(s)
if len(s) >= 2:
	print(len(s) - 2)
elif len(s) == 1:
	print('1')
else:
	print('0')


z = input()
if z == '{}':
	print(0)
else:
	z = z[1:-1].split(', ')
	p = {}
	for i in z:
		if i in p:
			p[i] += 1
		else:
			p[i] = 1
	print(len(p))


s = input()
s = s[1:len(s) - 1].replace(', ', '')
m = set()
for i in s:
	m.add(i)
print(len(m))


s = input()
x = ''
a = {}
for i in s:
	if i != '{' and i != '}' and (i != ' ') and (i != ','):
		x1 = x + i
		x = x1
for j in x:
	if j not in a:
		a[j] = 1
	else:
		a[j] += 1
print(len(a))


n = input()
a = set()
for k in n:
	if k != ',' and k != '{' and (k != '}') and (k != ' '):
		a.add(k)
print(len(a))


n = input()
m = []
for i in range(len(n)):
	if n[i].isalpha() == True:
		m.append(n[i])
m = set(m)
print(len(m))


a = input()
a = a.replace('}', ',')
a = a.replace(' ', '')
a = a.replace('{', '')
a = a.replace(',', '')
d = set(a)
print(len(d))


while True:
	try:
		l = str(input())
		s = 0
		n = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
		for i in range(26):
			t = n[i]
			if t in l:
				s = s + 1
			else:
				s = s
		print(s)
	except EOFError:
		break


a = list(input())
s = set()
for i in a:
	if i.isalpha() == True:
		s.update(i)
print(len(s))


p = input()
print([len(set(p[1:-1].split(', '))), 0][p == '{}'])


import re
s = input().split()
s = ' '.join(s)
res1 = ' '.join(re.split('[^a-zA-Z]*', s))
print(len(set(res1)) - 1)


alpha = input()
fil = []
for x in list(alpha):
	if x != '{' and x != ',' and (x != '}') and (x != ' ') and (x not in fil):
		fil.append(x)
print(len(fil))


s = input()
p = set()
for i in s:
	if ord(i) >= 97 and ord(i) <= 122:
		p.add(i)
print(len(p))


n = input()
a = []
for i in n:
	if i != '{' and i != '}' and (i != ' ') and (i != ','):
		a.append(i)
print(len(set(a)))


our_set = list(input().strip('{').strip('}').split(', '))
distinct = []
if our_set == ['']:
	print(0)
else:
	for letter in our_set:
		if letter not in distinct:
			distinct.append(letter)
	print(len(distinct))


s = input()
r = 0
for x in 'azertyuiopqsdfghjklmwxcvbn':
	if x in s:
		r += 1
print(r)


s = input()
a = []
for i in range(len(s)):
	if s[i] not in a:
		a.append(s[i])
ans = len(a) - 4
if ans == -2:
	print('0')
elif ans == -1:
	print('1')
else:
	print(ans)


listt = input()
ans = 0
check = '{}, '
for i in listt:
	if i not in check:
		check += i
		ans += 1
print(ans)


m = input()[1:-1]
if len(m) == 0:
	print(0)
else:
	m = m.split(', ')
	print(len(set(m)))


x = input()
if x == '{}':
	print(0)
elif len(x) == 3:
	print(1)
else:
	a = set()
	for i in range(1, len(x), 3):
		a.add(x[i])
	print(len(a))


line1 = input()
line1.split()
if ',' in line1:
	l = len(set(line1)) - 4
	print(l)
else:
	m = len(set(line1)) - 2
	print(m)


from sys import stdin, exit
line = stdin.readline().rstrip().replace('{', '').replace('}', '').split(', ')
if line[0] == '':
	print(0)
	exit()
chars = [0] * 26
for char in line:
	chars[ord(char) - 97] += 1
c = 0
for char in chars:
	if char >= 1:
		c += 1
print(c)


a = input()
b = ['{', '}', ' ', ',']
for i in b:
	a = a.replace(i, '')
print(len(set(a)))


import re
message = input()
message = re.sub('[{}, ]', '', message)
print(len(set(message)))


import re
lines = input()
lines = re.split('{|, |}', lines)
lines = list(filter(None, lines))
print(len(set(lines)))


origin = input()
origin = origin[1:-1]
letters = origin.split(', ')
sets = set(letters)
n = len(sets)
if '' in sets:
	n -= 1
print(n)


p = input()
if len(p) == 2:
	print(0)
elif len(p) == 3:
	print(1)
else:
	print(len(set(p)) - 4)


inp = input()[1:-1]
if inp == '':
	print('0')
else:
	print(len(set(inp.replace(' ', '').split(','))))


ans = set()
s = input()
for i in s:
	if i in 'abcdefghijklmnopqrstuvwxyz':
		ans.add(i)
print(len(ans))


from collections import Counter
b = []
d = input()
c = len(d)
if c > 3:
	a = d.split(', ')
	b.append(a[0][1])
	for i in range(1, len(a) - 1):
		b.append(a[i])
	b.append(a[len(a) - 1][0])
	print(len(dict(Counter(b))))
else:
	if c == 2:
		print('0')
	if c == 3:
		print('1')


a = input()
a = a[1:-1]
a = a.split(', ')
b = set(a)
if '' in b:
	print(0)
else:
	print(len(b))


a = set(input().strip('{}').split(', '))
if '' not in a:
	print(len(a))
else:
	print(0)


s = input()
a = []
for i in s:
	if i.isalpha():
		a.append(i)
l = set(a)
m = list(l)
print(len(m))


ins = input().lstrip('{').rstrip('}').split(',')
alpha = [1 for i in range(26)]
count = 0
for s in ins:
	if s.strip():
		count += alpha[ord(s.strip()) - 97]
		alpha[ord(s.strip()) - 97] = 0
print(count)


s1 = input()
if s1 == '{}':
	print(0)
else:
	s2 = s1.lstrip('{')
	s3 = s2.rstrip('}')
	x = s3.split(', ')
	count = set()
	for letter in x:
		if letter not in count:
			count.add(letter)
	print(len(count))


str1 = input()
if str1 == '{}':
	print(0)
elif len(str1) == 3:
	print(1)
else:
	dict1 = {}
	for i in str1:
		if i not in dict1:
			dict1[i] = 1
		else:
			dict1[i] += 1
	print(len(dict1) - 4)


inp = input()
inp = inp[1:-1]
count = 0
occur = []
for i in range(0, len(inp), 3):
	if inp[i] not in occur:
		count += 1
		occur.append(inp[i])
print(count)


s = input()
x = []
for i in range(len(s)):
	if s[i] == '{' or s[i] == '}' or s[i] == ',' or (s[i] == ' '):
		continue
	else:
		x.append(s[i])
p = set(x)
print(len(p))


n = input()
l = [0] * 100
for i in range(len(n)):
	if ord(n[i]) <= ord('z') and ord(n[i]) >= ord('a'):
		l[ord(n[i]) - ord('a')] = 1
ans = 0
for i in range(26):
	if l[i] != 0:
		ans += 1
print(ans)


s = input()
c = {}
for i in s:
	if i >= 'a' and i <= 'z':
		c[i] = 55
print(len(c))


s = input() + ', '
t = set(s)
print(len(t) - 4)


a = input()
q = []
for i in a:
	if i.isalpha():
		if i not in q:
			q.append(i)
print(len(q))


s = input()
letter = []
for i in range(len(s)):
	if ord(s[i]) <= 122 and ord(s[i]) >= 97:
		letter.append(s[i])
letter = sorted(letter, key=lambda x: ord(x))
b = 0
while b < len(letter) - 1:
	if letter[b] == letter[b + 1]:
		letter.pop(b + 1)
	else:
		b += 1
print(len(letter))


S = input()
S = S.strip('{}').split(', ')
ans = 0
if len(S) == 1 and S[0] == '':
	ans = 0
else:
	ans = len(set(S))
print(ans)


letters = set(input())
distinct_letters = 0
for e in letters:
	num_letter = ord(e)
	if num_letter > 96 and num_letter < 123:
		distinct_letters += 1
print(distinct_letters)


line = input()
n = len(line)
s = []
for i in range(n):
	if 'a' <= line[i] <= 'z':
		s.append(line[i])
	else:
		pass
sums = len(s)
if sums > 1:
	a = 1
	s.sort()
	for i in range(sums - 1):
		if s[i + 1] == s[i]:
			pass
		else:
			a += 1
if sums == 1:
	a = 1
if sums == 0:
	a = 0
print(a)


v = input()
a = []
count = 0
for i in range(len(v)):
	if v[i] == '}' or v[i] == '{' or v[i] == ',' or (v[i] == ' '):
		continue
	else:
		a.append(v[i])
b = []
for i in a:
	if i not in b:
		b.append(i)
for i in b:
	count = count + 1
print(count)


n = list(input())
count = 0
for x in n:
	if x == '{':
		n.remove(x)
	if x == '}':
		n.remove(x)
	if x == ',':
		n.remove(x)
n = set(n)
if len(n) > 1:
	print(len(n) - 1)
elif len(n) == 1 and '{' not in n and ('}' not in n):
	print(len(n))
else:
	print(len(n) - 1)


(a, b) = (list(input()), set())
for i in a:
	if i != '{' and i != '}' and (i != ',') and (i != ' '):
		b.add(i)
print(len(b))


s = input()
mapa = {}
for c in s:
	if c.isalpha():
		mapa[c] = 1
print(len(mapa))


res = input()[1:-1]
print(len(set(res.split(', '))) if res else 0)


import re
m = input()
s = []
l = []
for i in range(len(m)):
	if 97 <= ord(m[i]) <= 122:
		s.append(ord(m[i]))
s.sort()
t = 96
for i in range(len(s)):
	if s[i] > t:
		l.append(s[i])
		t = s[i]
print(len(l))


string = input()
inlist = []
for i in string:
	inlist.append(i)
inlist.remove('{')
inlist.remove('}')
for i in inlist:
	if i == ',':
		inlist.remove(i)
for i in inlist:
	if i == ' ':
		inlist.remove(' ')
print(len(set(inlist)))


l = list(input())
t = set()
for i in l:
	if i != '{' and i != '}' and (i != ',') and (i != ' '):
		t.add(i)
print(len(t))


s = input()
st = set()
for c in s:
	if c.isalpha():
		st.add(c)
print(len(st))


from sys import stdin as cin
from math import factorial as f
from itertools import combinations as comb
from collections import Counter as C
s = input()
s = s[1:]
n = len(s)
s = s[:n - 1]
m = list(s.split(', '))
if m == ['']:
	print(0)
else:
	r = C(m)
	print(len(list(r)))


s = input()
a = set()
if '{}' in s:
	print(0)
else:
	for l in s:
		if l.isalpha():
			a.add(l)
	print(len(a))


l = input()[1:-1].split(',')
uniqL = []
if len(l) == 1 and l[0] == '':
	print('0')
else:
	for x in l:
		k = x.strip()
		if k not in uniqL:
			uniqL.append(k)
	print(len(uniqL))


d = input()
d = d[1:-1]
if d == '':
	print(0)
else:
	num = d.split(', ')
	print(len(set(num)))


s = input()
alphapet = 'abcdefghijklmnopqrstuvwxyz'
uniq = []
for ch in s:
	if ch in alphapet and ch not in uniq:
		uniq.append(ch)
print(len(uniq))


x = input()
x = x[1:len(x) - 1]
x = x.replace(' ', '')
x = x.split(',')
c = set()
for i in x:
	if i == '':
		pass
	else:
		c.add(i)
print(len(c))


s = list(map(str, input().split(', ')))
ist = str(s)
ist = ist.replace(',', '')
ist = ist.replace('[', '')
ist = ist.replace(']', '')
ist = ist.replace(' ', '')
ist = ist.replace('{', '')
ist = ist.replace('}', '')
o = ''.join(set(ist))
print(len(o) - 1)


s = input().strip()
s = s[1:len(s) - 1]
if len(s) == 0:
	print(0)
	exit()
s = s.split(', ')
a = set()
for i in s:
	a.add(i)
print(len(a))


s = input()
s = set(s)
s.remove('{')
s.remove('}')
if ' ' in s:
	s.remove(' ')
if ',' in s:
	s.remove(',')
print(len(s))


pismena = set(input().strip('{}').split(', '))
if pismena == set(['']):
	pismena = set()
print(len(pismena))


inp = input()
ans = 0
for i in range(1, len(inp) - 1):
	interm = 0
	if inp[i] != ' ' and inp[i] != ',':
		for j in range(0, i):
			if inp[i] == inp[j]:
				interm += 1
		if interm == 0:
			ans = ans + 1
print(ans)


a = input()
b = [0] * 30
for i in range(0, len(a)):
	get = ord(a[i]) - 96
	if get > 0 and get < 27:
		if b[get] == 0:
			b[get] = 1
print(sum(b))


ss = set()
s = input()
for x in s:
	if x.isalpha():
		ss.add(x)
print(len(ss))


n = input()
d = []
for i in range(0, len(n)):
	if n[i] not in d and n[i] != ',' and (n[i] != '{') and (n[i] != '}') and (n[i] != ' '):
		d.append(n[i])
print(len(d))


s = input().strip('{}')
print(len(set(s.split(sep=', '))) if len(s) != 0 else 0)


line = input()
lettersList = []
for i in range(len(line)):
	lettersList.append(line[i])
counter = 0
for i in range(0, len(lettersList)):
	if lettersList[i] in 'abcdefghijklmnopqrstuvwxyz':
		counter += 1
		for j in range(i - 1, -1, -1):
			if lettersList[i] == lettersList[j]:
				counter -= 1
				break
print(counter)


s = input()
t = set()
for i in s:
	if i.isalpha():
		t.add(i)
print(len(t))


s = input()
if s == '{}':
	c = set()
else:
	c = set(s[1:len(s) - 1].split(', '))
print(len(c))


__author__ = 'myduomilia'
a = input()[1:-1].split(',')
s = set()
for val in a:
	if val != '':
		s.add(val.strip())
print(len(s))


s = input()
s = s[1:-1]
if len(s) == 0:
	print(0)
else:
	L = s.split(', ')
	s1 = set()
	for i in L:
		s1.add(i)
	print(len(s1))


print(len(set(input()) - set('{}, ')))


lst = input().split('{')[1].split('}')[0].split(', ')
st = set(lst)
if st == {''}:
	print('0')
else:
	print(len(st))


s = input()
s = s[1:-1]
s = set(s)
res = []
count = 0
for val in s:
	if val.isalpha():
		res.append(val)
	else:
		pass
res = list(set(res))
print(len(res))


a = input()
b = len(a)
if b == 2:
	print('0')
else:
	A = set()
	i = 1
	while i < b:
		A.add(a[i])
		i += 3
	print(len(A))


s = input()
ar = []
for i in range(1, len(s), 3):
	ar.append(s[i])
if s[1] == '}':
	print(0)
else:
	print(len(set(ar)))


s = input()
n = 2
if s.count(' ') > 0:
	n += 1
if s.count(',') > 0:
	n += 1
print(len(set(s)) - n)


a = input().split(', ')
a[0] = a[0][1]
a[-1] = a[-1][0]
if a[0] >= 'a' and a[0] <= 'z':
	print(len(set(a)))
else:
	print(0)


def rint():
	return int(input())

def rints():
	return list(map(int, input().split()))
print(len({c for c in input() if ord('a') <= ord(c) <= ord('z')}))


s = input()
l = []
a = 'abcdefghijklmnopqrstuvwxyz'
for i in range(len(s)):
	if s[i] in a:
		l.append(s[i])
print(len(set(l)))


arr = set(map(str, input().strip()))
while ',' in arr:
	arr.remove(',')
while '{' in arr:
	arr.remove('{')
while '}' in arr:
	arr.remove('}')
while ' ' in arr:
	arr.remove(' ')
print(len(arr))


s = input()
se = set()
for i in s:
	if str(i) != '}' and str(i) != '{' and (str(i) != ',') and (str(i) != ' '):
		se.add(i)
print(len(se))


s = input()
se = set({})
for x in s:
	if x.islower():
		se.add(x)
print(len(se))


s = input()
print(len(set((str(x) for x in s.replace('}', '').replace('{', '').split(', ') if x))))


s = input()
s = s.replace('{', '')
s = s.replace('}', '')
s = s.replace(',', '')
sum = 0
for i in range(97, 123):
	if s.count(chr(i)) != 0:
		sum += 1
print(sum)


c = input()
if c == '{}':
	print(0)
else:
	v = c[1:-1]
	b = v.split(', ')
	print(len(set(b)))


x = input()
ina = []
for i in x:
	if i != ',' and i != '{' and (i != '}') and (i != ' '):
		ina.append(i)
out = []
count = 0
for i in ina:
	if i not in out:
		out.append(i)
		count += 1
print(count)


import sys
print(sum((1 for x in set(sys.stdin.readline()[1:-2].split(', ')) if len(x))))


l = input().strip()
l = [x for x in l if x.isalpha()]
S = set(l)
print(len(S))


l = input()
l = l.replace('{', '')
l = l.replace('}', '')
l = l.replace(',', '')
l = l.split()
print(len(set(l)))


letters = input()
line = set()
for l in letters:
	if l.isalpha():
		line.add(l)
print(len(line))


s = input()
c = set()
for i in s:
	if i.isalpha():
		c.add(i)
print(len(c))


temp = input()
if len(temp) == 2:
	print(0)
else:
	temp = temp[1:len(temp) - 1].split(',')
	for i in range(0, len(temp)):
		temp[i] = temp[i].strip()
	print(len(set(temp)))


f = input()
f = set(f)
n = len(f)
if len(f) == 2:
	print(0)
elif len(f) == 3:
	print(1)
else:
	print(n - 4)


letter = list(input())
letter = ''.join(letter[1:len(letter) - 1])
letter = list(letter.split(','))
letter = ''.join(letter)
letter = list(letter.split(' '))
letter = set(letter)
letter = ''.join(letter)
print(len(letter))


a = input().split(', ')
a[0] = a[0][1:]
a[-1] = a[-1][:1]
if '}' not in a:
	l = []
	for i in a:
		if i not in l:
			l.append(i)
	print(len(l))
else:
	print(0)


print(len(set({x for x in input() if x.isalpha()})))


import sys

def main(stdin):
	return len(set([e for e in stdin[0][1:-1].split(', ') if e != '']))
skip_first_line = False
stdin = [ln for ln in [ln.rstrip() for ln in sys.stdin.readlines()[1 if skip_first_line else 0:]] if len(ln) > 0]
print(main(stdin))


line = input().split(',')
n = 0
s = []
if line[0][1] != '}':
	for i in line:
		if i[1] not in s:
			s.append(i[1])
			n += 1
print(n)


exec(f"{','.join('abcdefghijklmnopqrstuvwxyz')}={','.join(map(str, range(26)))}")
print(len(eval(input())))


a = input()
b = a[1:-1]
c = list(b.split(','))
dis = []
t = 0
for i in c:
	i = i.lstrip()
	if i not in dis and i != '':
		dis.append(i)
print(len(dis))


alf = input()
alf = alf[1:-1]
if bool(alf) is True:
	alf = alf.split(',')
	for i in range(len(alf)):
		alf[i] = alf[i].strip()
print(len(set(alf)))


clr = input()
temp = []
for i in range(len(clr)):
	if clr[i].isalpha():
		temp.append(clr[i])
print(len(set(temp)))


s = input()
s = list(set(s))
k = 0
for i in s:
	k += 1
if k > 3:
	print(k - 4)
elif k == 3:
	print(1)
else:
	print(0)


print(len(set([i for i in input()[1:-1].split(', ') if i != ''])))


a = []
for i in input():
	if i.isalpha() == True and i not in a:
		a.append(i)
print(len(a))


j = input()
i = 1
l = []
d = set()
while i < len(j):
	if j[i] == '}':
		break
	d.add(j[i])
	i = i + 3
print(len(d))


n = input()
n = n.replace(', ', '')
n = list(n[1:-1])
print(len(set(n)))


line = str(input())
t = 0
if 'a' in line:
	t += 1
if 'b' in line:
	t += 1
if 'c' in line:
	t += 1
if 'd' in line:
	t += 1
if 'e' in line:
	t += 1
if 'f' in line:
	t += 1
if 'g' in line:
	t += 1
if 'h' in line:
	t += 1
if 'i' in line:
	t += 1
if 'j' in line:
	t += 1
if 'k' in line:
	t += 1
if 'l' in line:
	t += 1
if 'm' in line:
	t += 1
if 'n' in line:
	t += 1
if 'o' in line:
	t += 1
if 'p' in line:
	t += 1
if 'q' in line:
	t += 1
if 'r' in line:
	t += 1
if 's' in line:
	t += 1
if 't' in line:
	t += 1
if 'u' in line:
	t += 1
if 'v' in line:
	t += 1
if 'w' in line:
	t += 1
if 'x' in line:
	t += 1
if 'y' in line:
	t += 1
if 'z' in line:
	t += 1
print(t)


s = input()
kek = set()
for i in s[1:len(s) - 1]:
	if i == ' ' or i == ',':
		continue
	kek.add(i)
print(len(kek))


s = input()
k = s[1:len(s) - 1]
l = k.split(', ')
if len(l) == 1 and l[0] == '':
	print(0)
else:
	print(len(set(l)))


alpha = 'abcdefghijklmnopqrstuvwxyz'
s = input()
res = set()
for ch in s:
	if ch in alpha:
		res.add(ch)
print(len(res))


s = input()
uniq = set()
for c in s:
	if c.isalpha():
		uniq.add(c)
print(len(uniq))


import sys

def gets():
	return sys.stdin.readline().strip()
s = gets()
a = set()
for i in range(1, len(s) - 1, 3):
	if s[i] != ' ':
		a.add(s[i])
print(len(a))


st = input()
st = list(st[1:-1])
k = 0
for i in range(ord('a'), ord('z') + 1):
	x = st.count(chr(i))
	if x:
		k += 1
print(k)


huruf = input()
hasil = []
for i in range(1, len(huruf), 3):
	if huruf[i] not in hasil and i != len(huruf) - 1:
		hasil += huruf[i]
print(len(hasil))


s = input()
l = []
for i in s:
	if ord(i) > 96 and ord(i) < 123:
		l.append(i)
l = set(l)
print(len(l))


X = input()
X = X.replace('{', '')
X = X.replace('}', '')
X = X.replace(',', '')
X = X.replace(' ', '')
X = set(X)
print(len(X))


s = input()
if len(s) > 2:
	letters = set(s[1:-1].split(', '))
	print(len(letters))
else:
	print(0)


import sys
s = sys.stdin.readline()[1:][:-2]
if len(s) == 0:
	print('0')
else:
	print(len(dict.fromkeys(s.split(', '))))


s = input()
s = s[1:len(s) - 1]
u = []
for i in range(0, len(s), 3):
	u = u + [s[i]]
u = set(u)
print(len(u))


from __future__ import division, print_function
import sys
from sys import stdin, stdout
import bisect
from bisect import bisect_left as bl
from bisect import bisect_right as br
import itertools
from collections import Counter
import collections
import math
import heapq
import re

def modinv(n, p):
	return pow(n, p - 2, p)

def cin():
	return map(int, sin().split())

def ain():
	return list(map(int, sin().split()))

def sin():
	return input()

def inin():
	return int(input())

def Divisors(n):
	l = []
	for i in range(1, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n // i == i:
				l.append(i)
			else:
				l.append(i)
				l.append(n // i)
	return l

def most_frequent(list):
	return max(set(list), key=list.count)

def GCD(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def ncr(n, r, p):
	t = fact[n] * (ifact[r] * ifact[n - r] % p) % p
	return t

def Convert(string):
	li = list(string.split(''))
	return li

def SieveOfEratosthenes(n):
	global prime
	prime = [True for i in range(n + 1)]
	p = 2
	while p * p <= n:
		if prime[p] == True:
			for i in range(p * p, n + 1, p):
				prime[i] = False
		p += 1
	f = []
	for p in range(2, n):
		if prime[p]:
			f.append(p)
	return f
prime = []
q = []

def dfs(n, d, v, c):
	global q
	v[n] = 1
	x = d[n]
	q.append(n)
	j = c
	for i in x:
		if i not in v:
			f = dfs(i, d, v, c + 1)
			j = max(j, f)
	return j

def main():
	s = sin()
	s = list(s)
	arr = []
	for i in range(1, len(s) - 1):
		if s[i] == ',' or s[i] == ' ':
			continue
		arr.append(s[i])
	print(len(set(arr)))
py2 = round(0.5)
if py2:
	from future_builtins import ascii, filter, hex, map, oct, zip
	range = xrange
import os, sys
from io import IOBase, BytesIO
BUFSIZE = 8192

class FastIO(BytesIO):
	newlines = 0

	def __init__(self, file):
		self._file = file
		self._fd = file.fileno()
		self.writable = 'x' in file.mode or 'w' in file.mode
		self.write = super(FastIO, self).write if self.writable else None

	def _fill(self):
		s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
		self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
		return s

	def read(self):
		while self._fill():
			pass
		return super(FastIO, self).read()

	def readline(self):
		while self.newlines == 0:
			s = self._fill()
			self.newlines = s.count(b'\n') + (not s)
		self.newlines -= 1
		return super(FastIO, self).readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.getvalue())
			(self.truncate(0), self.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		if py2:
			self.write = self.buffer.write
			self.read = self.buffer.read
			self.readline = self.buffer.readline
		else:
			self.write = lambda s: self.buffer.write(s.encode('ascii'))
			self.read = lambda : self.buffer.read().decode('ascii')
			self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


x = input()
print(len(set(str(x)[1:-1].split(', '))) if len(str(x)) > 2 else '0')


TN = 1

def solution():
	s = input()[1:-1]
	ans = len(set(s))
	if ans < 1:
		print(0)
	elif ans == 1:
		print(ans)
	else:
		print(ans - 2)
while TN != 0:
	solution()
	TN -= 1


st = input()
count = 0
has = [0 for i in range(26)]
i = 1
while True:
	if st[i] == '}':
		break
	else:
		if has[ord(st[i]) - ord('a')] == 0:
			count += 1
			has[ord(st[i]) - ord('a')] = 1
		if st[i + 1] == '}':
			break
		else:
			i += 3
print(count)


s = input()
s = s[1:len(s) - 1]
if len(s) == 0:
	print(0)
else:
	ss = s.split(', ')
	set = set()
	for i in ss:
		set.add(i)
	print(len(set))


m = set(input())
m.discard(' ')
m.discard(',')
m.discard('{')
m.discard('}')
print(len(m))


numbers = input()
numbers = numbers[1:-1]
numbers = set(numbers.split(', '))
if '' in numbers:
	print(0)
else:
	print(len(numbers))


x = input()
d = []
for i in range(len(x)):
	if x[i] != '{' and x[i] != '}' and (x[i] != ' ') and (x[i] != ','):
		d.append(x[i])
s = list(set(d))
print(len(s))


def solve(string):
	letters = []
	count = 1
	if len(string) > 2:
		for i in range(0, len(string) - 1, 1):
			if string[i].isalpha():
				letters.append(string[i])
		for j in range(1, len(letters), 1):
			if sorted(letters)[j] != sorted(letters)[j - 1]:
				count += 1
	else:
		count = 0
	return count
s = str(input())
print(solve(s))


s1 = str(input())
if len(s1) == 2:
	print(0)
else:
	s2 = s1[1:-1]
	s3 = s2.split(', ')
	s4 = ''.join(s3)
	s5 = set(s4)
	print(len(s5))


s = input()
s = [x for x in s if x != '{' and x != ',' and (x != '}') and (x != ' ')]
print(len(set(s)))


import re
s = input()
if s == '{}':
	print(0)
else:
	s = s[1:len(s) - 1]
	a = re.split('  |, ', s)
	print(len(set(a)))


a = input()
a = a[1:-1]
a = a.replace(', ', '')
a = list(set(a))
b = int(len(a))
print(b)


s = input()
ans = 0
for x in range(26):
	ch = chr(x + 97)
	if s.find(ch) != -1:
		ans += 1
print(ans)


a = input()
v = []
for i in a:
	if i.isalpha():
		v.append(i)
print(len(set(v)))


settle = input()
settle = settle[1:-1]
if settle:
	settle = settle.split(', ')
	settle = set(settle)
	length = len(settle)
	print(length)
else:
	print(0)


def solve(input):
	input = input[1:-1]
	if input == '':
		return 0
	else:
		return len(set(input.split(', ')))
print(solve(input()))


st = input()
st = st.replace(' ', '').lstrip('{').rstrip('}').replace(',', '')
s = set(st)
print(len(s))


x = input().split(',')
p = ''.join(x).split(' ')
k = ''.join(p)
l = set(k[1:len(k) - 1])
print(len(l))


s = input()
t = 0
for i in range(97, 123):
	if chr(i) in s:
		t = t + 1
print(t)


x = input()
s = 0
for i in list('abcdefghijklmnopqrstuvwxyz'):
	s = s + (i in x)
print(int(s))


s = input()
if s == '{}':
	print(0)
else:
	print(len(eval(s.replace(', ', "','").replace('{', "{'").replace('}', "'}"))))


s = input().strip('{').strip('}').replace(',', '')
l = set(filter(None, s.split(' ')))
print(len(l))


s = str(input())
a = set(s)
a.remove('{')
a.remove('}')
if ',' in a:
	a.remove(',')
if ' ' in a:
	a.remove(' ')
print(len(a))


x = input()
l = []
for i in range(1, len(x), 3):
	if x[i].isalpha():
		l.append(x[i])
print(len(set(l)))


s = input()
ns = s[1:len(s) - 1]
se = set()
for i in ns:
	if i != ',' and i != ' ':
		se.add(i)
print(len(se))


a = input()
st = set()
for i in a:
	if i >= 'a' and i <= 'z':
		st.add(i)
print(len(st))


a = input()
A = []
for i in range(len(a)):
	if a[i] not in ['{', '}', ',', ' ']:
		A.append(a[i])
print(len(set(A)))


str1 = input()
res = ''
for i in str1:
	if i != '{' and i != '}' and (i != ',') and (i != ' '):
		if i not in res:
			res += i
print(len(res))


huruf = input().lower()
x = len(huruf)
arr = []
total = 0
huruff = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for i in range(26):
	arr.append(0)
for i in huruf:
	for j in range(len(huruff)):
		if i == huruff[j]:
			arr[j] += 1
			break
if huruf == '{}':
	print(total)
else:
	for i in range(len(arr)):
		if arr[i] > 0:
			total += 1
	print(total)


s = input()
a = []
for i in s:
	if i >= 'a' and i <= 'z':
		a.append(i)
if len(a) == 0:
	print(0)
else:
	print(len(set(a)))


def trim_input_first_and_end(input_string):
	return input_string[1:len(input_string) - 1]

def remove_spaces_from_a_string(input_string):
	return input_string.replace(' ', '')

def unique(list1):
	unique_list = []
	for x in list1:
		if x not in unique_list:
			unique_list.append(x)
	return unique_list
a_set_values = input()
a_set_without_braces = trim_input_first_and_end(a_set_values)
if a_set_without_braces == '':
	print('0')
else:
	a_set_string_reformated = remove_spaces_from_a_string(trim_input_first_and_end(a_set_values))
	set_array_values = a_set_string_reformated.split(',')
	unique_set = unique(set_array_values)
	print(len(unique_set))


t = input()
s = t[1:len(t) - 1]
ans = 0
if len(t) == 2:
	ans = 0
else:
	li = s.split(', ')
	li = set(li)
	ans = len(li)
print(ans)


lst = []
c = 0
for i in input():
	if i.isalpha():
		lst += [i]
lst.sort()
for i in range(len(lst)):
	try:
		if lst[c] == lst[c + 1]:
			del lst[c]
		else:
			c += 1
	except IndexError:
		break
print(len(lst))


s = input()
k = list(s)
k.pop(0)
k.pop(-1)
u = set(k)
if ',' in u:
	u.remove(',')
if ' ' in u:
	u.remove(' ')
print(len(u))


l = input()
l = l[1:-1]
l = set(l)
length = len(l)
if length > 0:
	if ',' in l:
		length -= 1
	if ' ' in l:
		length -= 1
	print(length)
else:
	print('0')


a = input()
b = []
for i in range(1, len(a) - 1, 3):
	b.append(a[i])
b = set(b)
print(len(b))


st = input()
st = st.replace('{', '')
st = st.replace('}', '')
if len(st) == 0:
	print(0)
else:
	st = st.split(', ')
	print(len(set(st)))


s = input()
l = list(s)
s = ''.join(l)
s = s.replace(' ', '')
s = s.replace(',', '')
s = s.replace('}', '')
s = s.replace('{', '')
print(len(set(s)))


s = input()
k = {}
a = 0
for i in s:
	if i.isalpha() is True:
		k[i] = s.count(i)
for i in k.keys():
	a += 1
print(a)


thestr = input()
asdf = []
for n in thestr:
	if n in 'abcdefghijklmnopqrstuvwxyz':
		asdf.append(n)
noob = set(asdf)
print(len(noob))


a = input()
f = set()
import string
for i in a:
	if i in string.ascii_lowercase + string.ascii_uppercase:
		f.add(i)
print(len(f))


a = input('')
b = a.replace('{', ' ')
c = b.replace('}', ' ')
d = c.replace(',', ' ')
lis = list()
c = 0
for i in d:
	if i == ' ':
		c = 0
	else:
		lis.append(i)
		e = list(dict.fromkeys(lis))
try:
	print(len(e))
except:
	print(0)


a = input()
b = set(a)
b.remove('{')
b.remove('}')
if ' ' in b:
	b.remove(' ')
if ',' in b:
	b.remove(',')
print(len(b))


seq = list(map(str, input().split(', ')))
count = 0
res = []
for i in range(len(seq)):
	if i == 0 and seq[i][1] not in res:
		if seq[i][1] == '}':
			break
		res.append(seq[i][1])
	elif i != len(seq) - 1 and seq[i] not in res:
		res.append(seq[i])
	elif seq[i][0] not in res:
		res.append(seq[i][0])
print(len(res))


strSet = input()
strSet2 = strSet[1:-1].split(', ')
count = {}
for i in strSet2:
	if i in count:
		count[i] += 1
	else:
		count[i] = 1
print(0 if strSet == '{}' else len(count))


line = input()
a_set = set()
for x in line:
	if 'a' <= x <= 'z':
		a_set.add(x)
print(len(a_set))


l = input().strip(',').split()
if l == ['{}']:
	print(0)
else:
	l[0] = l[0].replace('{', '')
	l[-1] = l[-1].replace('}', '')
	l = list(map(lambda x: x.replace(',', ''), l))
	l = list(set(l))
	print(len(l))


a = input()
b = set(a)
count = 0
for i in b:
	if 'a' <= i <= 'z':
		count += 1
print(count)


print(len(set(input().strip('{}') + ', ')) - 2)


print(len(set(''.join((e for e in input() if e.isalnum())))))


import string
n = input()
nb = 0
for x in string.ascii_lowercase:
	if x in n:
		nb += 1
print(nb)


s = input()
lst = []
for i in range(len(s)):
	if s[i].isalpha():
		lst.append(s[i])
s1 = set(lst)
print(len(s1))


set = input()
if set != '{}':
	set = set[1:len(set) - 1].split(', ')
	tracked = []
	for item in set:
		if tracked.count(item) == 0:
			tracked.append(item)
	print(len(tracked))
else:
	print('0')


a = set(input())
a.discard(',')
a.discard(' ')
a.discard('{')
a.discard('}')
print(len(a))


s = input()
s = s[1:len(s) - 1]
groups = s.split(', ')
if len(s) == 0:
	print(0)
	exit()
count = 0
l = []
while count < len(groups):
	i = groups[count]
	if i not in l:
		l = l + [i]
	count += 1
print(len(l))


x = input()
if x == '{}':
	print(0)
else:
	print(len(set(x[1:-1].split(', '))))


l = list(input())
counter = 0
for x in range(97, 123):
	if chr(x) in l:
		counter += 1
print(counter)


A = input()
li = []
if len(A) > 2:
	for i in range(1, len(A), 3):
		li.append(A[i])
	se = set(li)
	print(len(se))
else:
	print(0)


import string
input_set = input()
ans = 0
for i in string.ascii_lowercase:
	if input_set.find(i) != -1:
		ans += 1
print(ans)


s = input()
l = [0] * 26
c = 0
for i in s:
	if i != '{' and i != '}' and (i != ' ') and (i != ','):
		l[ord(i) - 97] += 1
for i in range(0, 26):
	if l[i] != 0:
		c += 1
print(c)


x = list(input())
x.remove(x[0])
x.remove(x[len(x) - 1])
if len(x) > 0:
	l = ''.join(x)
	a = list(l.split(', '))
	s = set(a)
	print(len(s))
else:
	print(0)


s = input()
s = s[1:len(s) - 1]
l = s.split(', ')
f = []
for i in l:
	if i not in f:
		f.append(i)
if f == ['']:
	print('0')
else:
	print(len(f))


def map_func(x):
	if x[0] in '{}':
		x = x[1:]
	if x[len(x) - 1] in '{}':
		x = x[:len(x) - 1]
	return x
s = set(filter(None, map(map_func, input().split(', '))))
print(len(s))


def solve():
	a = input()
	if len(a) == 2:
		return 0
	return len(set(a[1:-1].split(', ')))
print(solve())


print(len(set(input().replace('{', '').replace('}', '').replace(',', '').replace(' ', ''))))


w = input()
if w == '{}':
	print(0)
else:
	x = set(list(w))
	x.remove('{')
	x.remove('}')
	if ',' in x:
		x.remove(',')
	else:
		pass
	if ' ' in x:
		x.remove(' ')
	print(len(x))


print(len(set(input().replace('{', '').replace('}', '').replace(',', '').replace(' ', '').rstrip())))


s = input()
lc = 0
for a in range(ord('a'), ord('z') + 1):
	c = chr(a)
	if c in s:
		lc += 1
print(lc)


s = input()
l = []
if s == '{}':
	print(0)
else:
	s = s.split(',')
	n = len(s) - 1
	for i in range(len(s)):
		if i == 0:
			l.append(s[0][1])
		elif i == n:
			l.append(s[i][-2])
		else:
			l.append(s[i][1])
	print(len(set(l)))


import re

def unique_letters(s):
	if not s:
		return 0
	s1 = ' '.join(re.findall('[a-zA-Z]+', s))
	a = list()
	for elem in s1:
		if elem.isalpha():
			a.append(elem)
	return len(set(a))
print(unique_letters(input()))


sets = input()
sets = sets[1:-1]
sets = sets.replace(', ', '')
print(len(set(sets)), end='')


s = input()
if len(set(s)) - 4 == -1:
	print(1)
elif len(set(s)) - 4 > 0:
	print(len(set(s)) - 4)
else:
	print(0)


setString = input()
if len(setString) > 2:
	setString = set(setString[1:-1].split(', '))
else:
	setString = []
print(len(setString))


import re
a = input()
print(len(set(''.join(re.findall('[a-z]', a)))))


st = input()
l = []
for i in st:
	if i >= 'a' and i <= 'z' and (i not in l):
		l.append(i)
print(len(l))


n = list(input())
b = []
for i in n:
	if i >= 'a' and i <= 'z':
		b.append(i)
b = set(b)
print(len(b))


string = input()
st = ''
for i in string:
	if '{' not in i and '}' not in i and (',' not in i) and (' ' not in i):
		st += i
print(len(set(st)))


s = input()
l = len(s)
ans = set()
for i in range(1, l - 1, 3):
	ans.add(s[i])
print(len(ans))


import sys
import math
s = input()
if s == '{}':
	print(0)
	sys.exit()
s = s[1:len(s) - 1]
s = list(s.split(', '))
print(len(set(s)))


s = input()
n = len(s)
p = s[1:n - 1]
if n == 3 and s[1] == ' ':
	print(0)
elif n == 3 and s[1] != ' ':
	print(1)
elif n == 2:
	print(0)
else:
	l = []
	l = p.split(', ')
	list_set = []
	list_set = set(l)
	print(len(list_set))


Set = set()
for i in input():
	if i.isalpha():
		Set.add(i)
print(len(Set))


s = input()
s = s[1:-1]
li = s.split(', ')
li = list(set(li))
if li[0] == '':
	print(0)
else:
	print(len(li))


n = input()
n = n[1:]
n = n[:-1]
if n == '':
	print(0)
elif len(set(n)) == 1:
	print(1)
else:
	print(len(set(n)) - 2)


x = input()
numbers = [i for i in x[1:len(x) - 1].split(', ') if i != '']
count = 0
for i in range(len(numbers)):
	if numbers[i] not in numbers[:i]:
		count += 1
print(count)


x = input()
if x[0] == '{' and x[1] == '}':
	print(0)
elif len(x) == 3:
	print(1)
else:
	a = []
	for i in range(0, len(x)):
		a.append(x[i])
	a.remove(a[0])
	a.remove(a[len(a) - 1])
	a = set(a)
	print(len(a) - 2)


s = input().strip()
a = set()
if len(s) == 2:
	print(0)
else:
	for i in range(1, len(s), 3):
		a.add(s[i])
	print(len(a))


st1 = list(input())
f = [0] * 26
for i in range(len(st1)):
	if ord('a') <= ord(st1[i]) <= ord('z'):
		f[ord(st1[i]) - 97] = 1
print(sum(f))


x = input()
n = len(x)
set1 = set(x)
set1.remove('{')
set1.remove('}')
if ',' in set1:
	set1.remove(',')
if ' ' in set1:
	set1.remove(' ')
print(len(set1))


a = list(input())
b = []
lena = len(a)
count = 1
while count < lena:
	b.append(a[count])
	count += 3
c = set(b)
if a[1] == '}':
	c = []
print(len(c))


n = input()
l = len(n)
z = 0
for i in range(l):
	if n[i] in {'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm'}:
		z = z + 1
		for j in range(i):
			if n[i] == n[j]:
				z = z - 1
				break
print(z)


a = input()
b = []
if len(a) == 2:
	print(0)
else:
	for i in range(1, len(a), 3):
		if a[i] not in b:
			b.append(a[i])
	print(len(b))


a = input()
a = a.replace(', ', '')
g = 26 * [0]
for i in range(1, len(a) - 1):
	g[ord(a[i]) - ord('a')] = 1
print(g.count(1))


x = input().split(',')
y = ','.join(x)
y = y.replace('{', ' ')
y = y.replace('}', ' ')
y = y.replace(' ', '')
x = y.strip()
x = x.split(',')
x = list(set(x))
if x[0] == '':
	print('0')
else:
	print(len(x))


letters = list(map(str, input().split()))
for i in range(0, len(letters)):
	if '{' in letters[i]:
		letters[i] = letters[i].replace('{', '')
	if '}' in letters[i]:
		letters[i] = letters[i].replace('}', '')
	if ',' in letters[i]:
		letters[i] = letters[i].replace(',', '')
a = len(set(letters))
if letters == ['']:
	a = 0
print(a)


theSet = set([x for x in input()[1:-1].split(', ') if x is not ''])
print(len(theSet))


import re
line = list(re.split('{|, |}', input()))
line = sorted(line)
total = 1
for i in range(1, len(line)):
	if line[i] != line[i - 1]:
		total += 1
print(total - 1)


s = input()
s1 = s[1:len(s) - 1]
l = []
for i in range(0, len(s1), +3):
	l.append(s1[i])
print(len(set(l)))


s = input()
s = s[1:]
s = s[:-1]
x = ''
if len(s) == 0:
	print(0)
	exit(0)
if len(s) == 1:
	print(1)
	exit(0)
cnt = 0
for i in s:
	if i not in x:
		cnt += 1
		x += i
print(cnt - 2)


letters = input()[1:-1]
print(0 if len(letters) == 0 else len(set(letters.split(', '))))


import re
s = input()
s = re.sub('[ {},]', '', s)
s = list(dict.fromkeys(s))
print(len(s))


a = set(input())
a = a - {',', '{', '}', ' '}
print(len(a))


s = set()
string = input().rstrip()
i = 1
while i < len(string):
	s.add(string[i])
	i += 3
if string == '{}':
	print(0)
else:
	print(len(s))


s = input()
L = list(s)
L1 = []
for i in L:
	if ord(i) >= 97 and ord(i) <= 122:
		L1.append(i)
print(len(set(L1)))


s = input()
dic = {}
count = 0
if s[1] == '}':
	print(0)
else:
	for i in range(1, len(s), 3):
		if s[i] not in dic:
			count = count + 1
			dic[s[i]] = 0
	print(count)


a = input().strip('{}').split(', ')
count = 0
a.sort()
for i in range(len(a) - 1):
	if a[i] != a[i + 1]:
		count += 1
if a[0] == '':
	print(0)
else:
	print(count + 1)


t = input()
t = t.lstrip('{')
t = t.rstrip('}')
m = t.split(', ')
if '' in m:
	m.remove('')
n = 0
l = []
for i in m:
	if i not in l:
		n += 1
		l.append(i)
print(n)


s = input()
for i in (('{', ''), ('}', ''), (', ', '')):
	s = s.replace(*i)
print(len(set(s)))


def solve(s):
	az = 'abcdefghijklmnopqrstuvwxyz'
	ss = set()
	for c in s:
		if c in az:
			ss.add(c)
	return len(ss)

def main():
	inp = input()
	print(solve(inp))
main()


t = input()
t = t.replace('{', '')
t = t.replace('}', '')
t = t.replace(',', '')
c = set(t)
if c.__len__() == 0 or c.__len__() == 1:
	print(c.__len__())
else:
	print(c.__len__() - 1)


s = input()
lo = 'abcdefghijklmnopqrstuvwxyz'
st = set()
for c in s:
	if c in lo and c not in st:
		st.add(c)
print(len(st))


x = str(input())
y = x[1:-1]
z = set(y.split(', '))
if len(x) == 2:
	print(0)
else:
	p = list(z)
	print(len(p))


letters = input()
ban_list = ['{', '}', ' ', ',']
for i in ban_list:
	letters = letters.replace(i, '')
print(len(set(letters)))


name = input()
name = set(name)
if len(name) < 4:
	print(len(name) - 2)
else:
	print(len(name) - 4)


inpt = str(input())
inpt = inpt[1:len(inpt) - 1]
inpt = inpt.replace(' ', '')
inpt = inpt.split(',')
if inpt.count('') > 0:
	inpt.remove('')
numoe = len(inpt)
n = 0
while n < numoe:
	if inpt.count(inpt[n]) > 1:
		inpt.remove(inpt[n])
		numoe = len(inpt)
		n = 0
	else:
		n += 1
numoe = len(inpt)
print(numoe)


x = input()
z = x.replace(' ', '')
if x == '{}':
	print(0)
else:
	separados = z[1:-1].split(',')
	print(len(set(separados)))


s = input()
new_s = []
for i in s:
	if i.isalpha():
		new_s.append(i)
new_s = list(dict.fromkeys(new_s))
print(len(new_s))


s = input()
se = set()
for i in s:
	if i == '{' or i == '}' or i == ',' or (i == ' '):
		continue
	else:
		se.add(i)
print(len(se))


data = input().replace(',', ' ').replace('{', '').replace('}', ' ').split()
print(len(set(data)))


s = input()
distinct = set()
for i in s:
	if i not in ('{', '}', ',', ' '):
		distinct.update(i)
	else:
		pass
print(len(distinct))


set1 = input()
set2 = []
for i in range(len(set1)):
	set2.append(set1[i])
numbers = []
for i in range(len(set2) // 3):
	numbers.append(set2[3 * i + 1])
numbers = set(numbers)
print(len(numbers))


a = str(input())
w = []
for i in a:
	if i == ' ' or i == ',' or i == '{' or (i == '}'):
		continue
	else:
		w.append(i)
e = set(w)
print(len(e))


import functools
n = input()[1:-1].split(', ')
count = [0 for _ in range(26)]
a_ord = ord('a')
result = 0
for i in n:
	if i and count[ord(i) - a_ord] == 0:
		count[ord(i) - a_ord] = 1
print(functools.reduce(lambda x, y: x + y, count, 0))


a = input()
a = set(a)
if ',' not in a:
	print(len(a) - 2)
else:
	print(len(a) - 4)


letters = input()
dist = []
for i in letters:
	if i not in ['{', '}', ',', ' ']:
		dist.append(i)
new_dist = []
for i in dist:
	if i not in new_dist:
		new_dist.append(i)
print(len(new_dist))


s = input()
l = []
for i in range(len(s)):
	if s[i] != ' ' and s[i] != ',' and (s[i] != '{') and (s[i] != '}'):
		l.append(s[i])
k = set(l)
print(len(k))


s = input()
x = ''
for i in s:
	if i.isalpha():
		x += i
print(len(set(x)))


a = input()
b = list(a)
invalid = ['{', ',', ' ', '}']
valid = []
for i in b:
	if i not in invalid:
		valid.append(i)
count = len(set(valid))
print(count)


a = input()[1:-1]
if len(a) > 3:
	print(len(set(a.split(', '))))
else:
	print(int(len(a) > 0))


def cal(s):
	if len(s) == 2:
		return 0
	if len(s) == 4:
		return 1
	s1 = s[1:-1]
	k = s1.split(sep=', ')
	dic = []
	for i in range(0, len(k)):
		if (k[i] in dic) == False:
			dic.append(k[i])
	return len(dic)
s = input()
print(cal(s))


s = input()
a = []
for i in s:
	if i != '{' and i != '}' and (i != ',') and (i != ' '):
		a.append(i)
print(len(set(a)))


s = input()
b = set()
for i in range(0, len(s)):
	if ord(s[i]) >= 97 and ord(s[i]) <= 122:
		b.add(s[i])
print(len(b))


import sys
instr = sys.stdin.readline()
a = instr[1:len(instr) - 2].split(', ')
a.sort()
k = a[0]
if k == '':
	count = 0
else:
	count = 1
for i in a[1:]:
	if k != i:
		count += 1
		k = i
print(count)


n = input()
a = set(n)
a = list(a)
if '{' in a:
	a.remove('{')
if '}' in a:
	a.remove('}')
if ',' in a:
	a.remove(',')
if ' ' in a:
	a.remove(' ')
print(len(a))


n = input()
l = []
for i in n:
	if i != '{' and i != '}' and (i != ',') and (i != ' '):
		l.append(i)
print(len(set(l)))


print(len(set([i for i in input().replace('{', '').replace('}', '').split(', ') if i.isalnum()])))


i = input()
print(0 if len(i) == 2 else len(set([x.strip() for x in i[1:-1].split(',')])))


s = input()
print([len(set(s[1:-1].split(', '))), 0][s == '{}'])


s = input()
set = set()
set.add(s[1])
if len(s) < 3:
	print('0')
else:
	for i in range(4, len(s)):
		if i % 3 == 1:
			set.add(s[i])
	print(len(set))


print(sum((x != '' for x in set(input()[1:-1].split(', ')))))


t = str(input())
t = sorted(t)
t = ''.join(t)
c = int()
for i in range(0, len(t)):
	if t[i] == ',':
		continue
	elif t[i] == '{':
		break
	elif t[i] == ' ':
		continue
	elif t[i] == t[i + 1]:
		c += 0
	else:
		c += 1
print(c)


lst = input()
lst = lst.strip('{')
lst = lst.strip('}')
lst = lst.split(', ')
n = len(lst)
text = {}
for l in lst:
	if l != '':
		text[l] = text.get(l, 0) + 1
num = len(text)
print(num)


zmb = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
l = input()
long = len(l)
lo = long / 3
n = 2
while n < long:
	x = ord(l[n - 1]) - 97
	zmb[x] = 1
	n = n + 3
q = sum(zmb)
print(q)


s = str(input())
l = []
counter = 0
for i in s:
	if i >= 'a' and i <= 'z':
		if i not in l:
			l.append(i)
print(len(l))


a = list(map(str, input().split(', ')))
b = a[0]
a[0] = b[1]
b = a[len(a) - 1]
a[len(a) - 1] = b[0]
c = []
if a == ['}']:
	print(0)
else:
	for i in range(len(a)):
		if not a[i] in c:
			c.append(a[i])
	print(len(c))


a = input()
a = set(a)
if len(a) > 3:
	print(len(a) - 4)
elif len(a) == 3:
	print('1')
else:
	print('0')


st = input()
st = st.strip('{')
st = st.strip('}')
if len(st) == 0:
	print(0)
else:
	arr = list(st.split(', '))
	s = set()
	for ele in arr:
		s.add(ele)
	print(len(s))


a = str(input())
wor = list()
if len(a) == 2:
	print(0)
else:
	for i in a:
		if i not in wor:
			wor.append(i)
	print(abs(len(wor) - 4))


in_set = input()
chars = []
for i in in_set:
	if i != '{' and i != '}' and (i != ' ') and (i != ','):
		chars.append(i)
print(len(set(chars)))


values = input().replace('{', '').replace('}', '').replace(',', '').split(' ')
if values == ['']:
	print(0)
else:
	print(len(set(values)))


s = input()
arr = s[1:len(s) - 1].split(',')
ls = []
for i in arr:
	i = i.strip()
	if i == '' or i == ' ':
		continue
	elif i not in ls:
		ls.append(i)
print(len(ls))


def letters(s, c):
	s = sorted(s)
	for i in range(len(s)):
		if ord(s[i]) >= 97 and ord(s[i]) <= 122:
			c += 1
			if ord(s[i]) == ord(s[i + 1]):
				c -= 1
	return c
s = input()
s_n = str(set(s))
count = 0
print(letters(s_n, count))


lst = input()[1:-1].split(', ')
count = 0
if lst != ['']:
	letters = [False for i in range(26)]
	for letter in lst:
		letters[ord(letter.lower()) - ord('a')] = True
	for letter in letters:
		if letter:
			count += 1
print(count)


sett = input()
dis = {}
for i in sett:
	if i not in "{},' '":
		if i not in dis:
			dis[i] = 1
print(len(dis))


s = input()
s = s.strip('{')
s = s.strip('}')
l = []
c = 0
for i in s:
	l.append(i)
new = []
for i in l:
	if i in new:
		continue
	elif i == ' ' or i == ',':
		continue
	else:
		new.append(i)
		c += 1
print(c)


a = input()
b = a[1:-1:3]
print(len(set(b)))


user = input()
l = []
for i in range(len(user)):
	if user[i].isalpha():
		l.append(user[i])
c = 0
s = set(l)
for i in s:
	c = c + 1
print(c)


a = input()
b = ''
for i in a:
	if i not in b and i not in (' ', ',', '{', '}'):
		b = b + i
print(len(b))


letters = input()
if letters == '{}':
	print(0)
else:
	line = []
	letters = letters[1:len(letters) - 1]
	for l in letters:
		if l.isalpha():
			line.append(l)
			output = list(set(line))
	print(len(output))


s = input()
ss = s.replace('{', '')
sss = ss.replace('}', '')
if sss == '':
	print('0')
else:
	lis = sss.split(', ')
	liss = list(dict.fromkeys(lis))
	print(len(liss))


p = list(input())
p = list(dict.fromkeys(p))
if len(p) == 2:
	print('0')
else:
	print(abs(len(p) - 4))


line = input()
n = set()
for l in line:
	if l != '{' and l != '}' and (l != ',') and (l != ' '):
		n.add(l)
print(len(n))


l = list(set(input()))
len = len(l) - 4
if len < -1:
	print(0)
elif len == -1:
	print(1)
else:
	print(len)


temp_str = str(input())
if temp_str == '{}':
	print(0)
else:
	print(len(list(set(temp_str[1:-1].split(', ')))))


s = input()
n = len(s)
c = []
for i in s:
	l = ord(i)
	if l >= 97 and l <= 122:
		c.append(i)
d = set(c)
print(len(d))


n = input()
l = []
if len(n) < 3:
	print(0)
else:
	s = n[1:-1]
	f = s[0::3]
	for letter in f:
		if letter not in l:
			l.append(letter)
	print(len(l))


line = input().replace('{', '')
line = line.replace('}', '')
line = line.split(',')
line = [x.replace(' ', '') for x in line if x != '']
line = set(line)
print(len(line))


n = list(str(input()))
a = 0
m = len(n)
if m == 2:
	a = 0
if m != 2:
	x = set(n)
	x.remove('{')
	x.remove('}')
	if len(x) == 1:
		a = 1
	else:
		x.remove(',')
		x.remove(' ')
		a = len(x)
print(a)


def main():
	string = str(input())
	s = set()
	for i in range(len(string)):
		if string[i] != '{' and string[i] != '}' and (string[i] != ',') and (string[i] != ' '):
			s.add(string[i])
	print(len(s))
main()


sttr = input()
sttr = set(sttr)
sttr.remove('}')
sttr.remove('{')
if ',' in sttr:
	sttr.remove(',')
if ' ' in sttr:
	sttr.remove(' ')
print(len(sttr))


import sys

def main():
	data = sys.stdin.readline().strip()[1:-1]
	datax = data.split(', ')
	datas = set(datax)
	if datax == ['']:
		print(0)
	else:
		print(len(datas))
main()


import re

def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input()

def listStr():
	return list(input())

def solve():
	S = getStr()
	S = S[1:-1]
	if len(S) == 0:
		return 0
	return len(set(S.split(', ')))
ans = solve()
print(ans)


s = input()
okay = 1
if len(s) == 2:
	print(0)
	okay = 0
if okay:
	s = s[1:len(s) - 1].split(', ')
	s = set(s)
	print(len(s))


s = input()
ns = ['{', ',', ' ', '}']
c = 0
for i in s:
	if i not in ns:
		ns.append(i)
		c += 1
print(c)


a = input()
if a == '{}':
	print(0)
elif ' ' not in set(a):
	print(1)
else:
	a = set(a)
	b = [' ', ',', '{', '}']
	for i in b:
		a.remove(i)
	print(len(a))


a = input()
b = 0
c = []
for i in a:
	if i != '{' and i != ',' and (i != ' ') and (i != '}') and (i not in c):
		b += 1
		c.append(i)
print(b)


l = input()
x = []
for i in range(len(l)):
	a = l[i]
	if a.islower() is True:
		x.append(a)
y = list(set(x))
print(len(y))


abc = list(input())
chars = list()
k = 0
for i in abc:
	if i.isalpha() and i not in chars:
		chars.append(i)
		k += 1
print(k)


string = input()
token = string[1:len(string) - 1]
if token:
	ans = set(token.split(', '))
	print(len(ans))
else:
	print(0)


def main():
	text = input()
	text = text.replace('{', '')
	text = text.replace('}', '')
	text = text.replace(',', '')
	s = set(text.split())
	print(len(s))
main()


s = str(input())
l = s.replace(',', '')
s = l.replace(' ', '')
s1 = list(s)
s1.pop(0)
s1.pop()
print(len(set(s1)))


import re
matches = re.findall('{*([a-z])}*', input())
print(len(set(matches)))


a = input()[1:-1]
c = set()
for i in a:
	if i not in (',', ' '):
		c.add(i)
print(len(c))


inp = input()
i = inp[1:-1]
l = list()
if len(i) > 0:
	l = i.split(', ')
b = list()
for j in l:
	if j not in b:
		b.append(j)
print(len(b))


a = input()
b = []
for letter in a:
	if letter.isalpha():
		if letter not in b:
			b.append(letter)
	else:
		continue
print(len(b))


s = input().strip()
if len(s) <= 2:
	print(0)
else:
	s = s[1:-1].split(',')
	d = {ch.strip() for ch in s}
	print(len(d))


s = input()
count = 0
uni = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
i = 1
while i < len(s) - 1:
	if uni[ord(s[i]) - 97] == 0:
		count += 1
		uni[ord(s[i]) - 97] += 1
	i += 3
print(count)


from collections import Counter
s = input()[1:-1].split(', ')
while '' in s:
	s.remove('')
print(len(Counter(s)))


s = input()
a = list()
for i in range(0, len(s)):
	if 'a' <= s[i] <= 'z':
		a.append(s[i])
i = 0
while i < len(a) - 1:
	if a[i] > a[i + 1]:
		(a[i], a[i + 1]) = (a[i + 1], a[i])
		i = -1
	i += 1
if len(a):
	k = 1
	for i in range(0, len(a) - 1):
		if a[i] != a[i + 1]:
			k += 1
else:
	k = 0
print(k)


strings = input()
words = []
if len(strings) <= 2:
	print(0)
else:
	for i in range(1, len(strings) - 1, 3):
		words.append(strings[i])
	match = []
	match.append(words[0])
	count = 1
	for i in range(1, len(words)):
		if words[i] in match:
			continue
		else:
			count += 1
			match.append(words[i])
	print(count)


str = input()
s2 = ''
c = 0
for i in str:
	if i >= 'a' and i <= 'z':
		s2 += i
li1 = list(s2)
li2 = []
for i in li1:
	if i not in li2:
		li2.append(i)
print(len(li2))


from collections import defaultdict
st = input().replace('{', '').replace('}', '').replace(', ', '')
if len(st) >= 1:
	d = defaultdict(lambda : 0)
	for i in st:
		d[ord(i)] += 1
	print(len(d))
else:
	print(0)


3
import sys
line = sys.stdin.readline()
s = set()
for c in line:
	if 'a' <= c <= 'z':
		s.add(c)
print(len(s))


x = input()
a = x[1:len(x) - 1]
z = a.split(', ')
anumber = 0
bnumber = 0
cnumber = 0
dnumber = 0
enumber = 0
fnumber = 0
gnumber = 0
hnumber = 0
inumber = 0
jnumber = 0
knumber = 0
lnumber = 0
mnumber = 0
nnumber = 0
onumber = 0
pnumber = 0
qnumber = 0
rnumber = 0
snumber = 0
tnumber = 0
unumber = 0
vnumber = 0
wnumber = 0
xnumber = 0
ynumber = 0
znumber = 0
if z.count('a') > 0:
	anumber = 1
if z.count('b') > 0:
	bnumber = 1
if z.count('c') > 0:
	cnumber = 1
if z.count('d') > 0:
	dnumber = 1
if z.count('e') > 0:
	enumber = 1
if z.count('f') > 0:
	fnumber = 1
if z.count('g') > 0:
	gnumber = 1
if z.count('h') > 0:
	hnumber = 1
if z.count('i') > 0:
	inumber = 1
if z.count('j') > 0:
	jnumber = 1
if z.count('k') > 0:
	knumber = 1
if z.count('l') > 0:
	lnumber = 1
if z.count('m') > 0:
	mnumber = 1
if z.count('n') > 0:
	nnumber = 1
if z.count('o') > 0:
	onumber = 1
if z.count('p') > 0:
	pnumber = 1
if z.count('q') > 0:
	qnumber = 1
if z.count('r') > 0:
	rnumber = 1
if z.count('s') > 0:
	snumber = 1
if z.count('t') > 0:
	tnumber = 1
if z.count('u') > 0:
	unumber = 1
if z.count('v') > 0:
	vnumber = 1
if z.count('w') > 0:
	wnumber = 1
if z.count('x') > 0:
	xnumber = 1
if z.count('y') > 0:
	ynumber = 1
if z.count('z') > 0:
	znumber = 1
print(anumber + bnumber + cnumber + dnumber + enumber + fnumber + gnumber + hnumber + inumber + jnumber + knumber + lnumber + mnumber + nnumber + onumber + pnumber + qnumber + rnumber + snumber + tnumber + unumber + vnumber + wnumber + xnumber + ynumber + znumber)


inp = list(input())
count = 0
d = dict()
for i in inp:
	if i == '{' or i == ',' or i == ' ' or (i == '}'):
		pass
	else:
		ls = d.get(i, 0)
		if ls == 0:
			count = count + 1
			d[i] = i
		else:
			pass
print(count)


s = input()
a = 'abcdefghijklmnopqrstuvwxyz'
distinct = 0
for l in a:
	if l in s:
		distinct += 1
print(distinct)


a = list(map(str, input()))
l = []
for i in range(0, len(a)):
	if a[i] >= 'a' and a[i] <= 'z':
		l.append(a[i])
print(len(set(l)))


s = input()
s = s.replace('{', '')
s = s.replace('}', '')
s = s.replace(',', '')
s = s.replace(' ', '')
arr = list(s)
s = set(arr)
print(len(s))


s = input()
s1 = s[1:len(s) - 1]
l = list(s1.split(', '))
res = []
if s == '{}':
	print(0)
else:
	[res.append(x) for x in l if x not in res]
	print(len(res))


s = input()
l = []
for i in range(0, len(s), 3):
	l.append(s[i + 1])
if ' ' in l:
	l.remove(' ')
if '}' in l:
	l.remove('}')
s = set(l)
print(len(s))


def rem(x):
	while x in b:
		b.remove(x)
	return
b = set(input())
rem('{')
rem('}')
rem(',')
rem(' ')
print(len(b))


a = input()
b = set()
c = ''
ans = 1
if a[1] == '}':
	ans = 0
for x in a[1:]:
	if x in ',}':
		b.add(c)
		c = ''
	elif x == ' ':
		continue
	else:
		c += x
if ans == 0:
	print(0)
else:
	print(len(b))


import sys
x = list(input())
x.sort()
let = []
for y in range(len(x)):
	let.append(str(x[y]))
let = list(dict.fromkeys(let))
let = sorted(let)
let.remove('{')
let.remove('}')
if len(let) == 1:
	print(1)
	sys.exit()
elif len(let) - 2 == 0:
	print(1)
	sys.exit()
elif len(let) - 2 < 0:
	print(0)
	sys.exit()
else:
	print(len(let) - 2)


def main():
	S = input().rstrip()
	ans = set(S + ', ')
	print(len(ans) - 4)
main()


n = input()
o = []
for i in n:
	if 'a' <= i <= 'z':
		o.append(i)
	else:
		continue
o.sort()
m = int(len(o))
if m == 0:
	print(0)
else:
	j = 1
	for i in range(m - 2):
		if o[i] != o[i + 1]:
			j = j + 1
	if o[m - 2] != o[m - 1]:
		j = j + 1
	print(j)


x = input()
L = []
for i in range(len(x)):
	if x[i] != ' ' and x[i] != ',' and (x[i] != '{') and (x[i] != '}'):
		if x[i] not in L:
			L.append(x[i])
print(len(L))


import re
A = input()
replacestr = '{|}'
B = re.sub(replacestr, '', A)
alphabet = B.split(', ')
alphabetunique = list(set(alphabet))
if A == '{}':
	print(0)
else:
	print(len(alphabetunique))


s = input()
s = s[1:-1]
a = [i for i in s.split(', ') if i]
s = set(a)
print(len(s))


input_letters = input()[1:-1].split(', ')
if input_letters[0] != '':
	all_the_letters = [chr(letter) for letter in range(ord('a'), ord('z') + 1)]
	key_value = {}
	for letter in all_the_letters:
		key_value[letter] = 0
	for letter in input_letters:
		if key_value[letter] == 0:
			key_value[letter] = 1
	count = 0
	for val in key_value.values():
		if val == 1:
			count += 1
	print(count)
else:
	print(0)


n = list(input())
del n[0]
del n[len(n) - 1]
t = []
for k in range(0, len(n), 3):
	if n[k] not in t:
		t.append(n[k])
t = ''.join(t)
print(len(t))


n = input().split('{')[1].split('}')[0].split(', ')
g = []
for i in range(len(n)):
	if n[i] not in g and n[i] != '':
		g.append(n[i])
print(len(g))


n = input()
s = set(n)
lst = list(s)
lst.remove('{')
lst.remove('}')
if ',' in lst:
	lst.remove(',')
if ' ' in lst:
	lst.remove(' ')
print(len(lst))


s = input()
l = len(s) - 1
c = []
for i in range(1, l, 3):
	if (s[i] != ',' or s[i] != ' ') and s[i] not in c:
		c.append(s[i])
print(len(c))


print(len(set(str(input()[1:-1]).replace(',', ' ').split())))


s = input()
if len(s) == 2:
	print(0)
else:
	a = s[1:-1].split(', ')
	print(len(set(a)))


x = input().strip()
a = []
for i in x:
	if ord(i) >= 97 and ord(i) <= 122:
		a.append(i)
print(len(set(a)))


letters = [x for x in input().split(', ')]
letters[0] = letters[0][1]
letters[len(letters) - 1] = letters[len(letters) - 1][0]
letters_unique = set(letters)
number = len(letters_unique)
if letters[0] == '{':
	number -= 1
if letters[len(letters_unique) - 1] == '}':
	number -= 1
print(number)


a = input().split(', ')
if a == ['{}']:
	print('0')
else:
	n = len(a)
	a[0] = a[0][1]
	a[n - 1] = a[n - 1][0]
	b = []
	for i in range(n):
		c = a[i]
		if c not in b:
			b += c
	print(len(b))


import math
line_ = input()
n = []
trueline = line_[1:-1]
count_ = 0
for i in trueline:
	if i != ',' and i != ' ':
		if trueline.count(i) == 1:
			count_ += 1
		elif i not in n:
			count_ += 1
			n += [i]
print(count_)


s1 = input()
if s1 == '{}':
	print('0')
else:
	s2 = s1.replace('{', '')
	s2 = s2.replace('}', '')
	s3 = s2.split(', ')
	s4 = set(s3)
	print(len(s4))


A = input().strip().split('{')[1].split('}')[0].split(', ')
if A == ['']:
	print(0)
else:
	print(len(set(A)))


a = str(input())
print(len(set([i for i in a if i in 'abcdefghijklmnopqrstuvwxyz'])))


a = input()
a = list(a)
i = 0
while True:
	if i == len(a) - 1:
		break
	if a[i] == ' ':
		a.remove(a[i])
	i += 1
a = ''.join(a)
b = []
b = a.split(',')
c = []
if a == '{}':
	print('0')
else:
	b[0] = b[0][-1]
	b[-1] = b[-1][0]
	for i in range(len(b)):
		if b[i] in c:
			c.append('0')
			c.remove('0')
		else:
			c.append(b[i])
	print(len(c))


s = input()
s = s[1:-1]
s = s.replace(', ', '')
l = []
for i in range(len(s)):
	if s[i] != ',' and s[i] not in l:
		l.append(s[i])
print(len(l))


s = input()
b = [0] * 27
c = 0
for i in s:
	if 96 < ord(i) < 123:
		b[ord(i) - ord('a')] += 1
for i in b:
	if i > 0:
		c += 1
print(c)


s = input()
k = s[1:-1].split(', ')
k = list(dict.fromkeys(k))
print(0 if s == '{}' else len(k))


sett = input()
ans = set()
for i in sett:
	if 97 <= ord(i) and ord(i) <= 122:
		ans.add(i)
print(len(list(ans)))


import re
letters = re.split('[,}{]+', input())
lis = [i.strip() for i in letters if i != '']
quchong = []
for i in lis:
	if i not in quchong:
		quchong.append(i)
print(len(quchong))


set = input()
s = list(set)
s.sort(key=ord)
str = 'abcdefghijklmnopqrstuvwxyz'
total = 0
for i in str:
	if i in s:
		total += 1
print(total)


from fractions import Fraction
import sys
import bisect
import heapq
from math import *
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
mod = 1000000007

def inp():
	return sys.stdin.readline().strip()

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def graph(vertex):
	return [[] for i in range(0, vertex + 1)]

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def lcm(a, b):
	return a * b // gcd(a, b)

def power(a, b):
	ans = 1
	while b > 0:
		if b % 2 == 1:
			ans *= a
		a *= a
		b //= 2
	return ans

def createMatrix(rowCount, colCount, dataList):
	mat = []
	for i in range(rowCount):
		rowList = []
		for j in range(colCount):
			if dataList[j] not in mat:
				rowList.append(dataList[j])
		mat.append(rowList)
	return mat

def isprime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
n = input()
n = list(n)
if '{' in n:
	n.remove('{')
if '}' in n:
	n.remove('}')
for i in range(len(n)):
	if ',' in n:
		n.remove(',')
	if ' ' in n:
		n.remove(' ')
n = set(n)
print(len(n))


s = input()
s = list(s)
k = []
for i in range(len(s)):
	if s[i].isalpha():
		k.append(str(s[i]))
k = int(len(set(k)))
print(k)


input_huruf = input()
sum = 0
temp = ['{', '}', ',', ' ']
for x in input_huruf:
	if x not in temp:
		temp.append(x)
		sum += 1
print(sum)


print(len(set([x for x in input() if 123 > ord(x) > 44])))


m = input()
m = m.replace('{', '')
m = m.replace('}', '')
m = m.replace(',', '')
m = m.replace(' ', '')
m = list(map(str, m))
s = []
c = 0
for i in range(len(m)):
	if m[i] not in s:
		s.append(m[i])
		c += 1
	else:
		continue
print(c)


k = input()
k = k[1:-1]
k = set(k.split(', '))
if k != {''}:
	print(len(k))
else:
	print(0)


line = input()
ch = []
for i in range(1, len(line), 3):
	ch.append(line[i])
ch2 = []
for i in ch:
	if i in ch2:
		continue
	else:
		ch2.append(i)
if line == '{}':
	print(0)
else:
	print(len(ch2))


s = input()
a = []
ans = 0
for char in s:
	if char != '{' and char != '}' and (char != ',') and (char != ' '):
		if char not in a:
			a.append(char)
			ans += 1
print(ans)


s = input()
s = s[1:-1]
s = [str(x) for x in s.split(', ')]
if s == ['']:
	print(0)
else:
	print(len(set(s)))


s = input()
l = set(s)
if len(l) >= 4:
	k = len(l) - 4
	print(k)
elif len(l) == 2:
	k = 0
	print(k)
elif len(l) > 2 and len(l) < 4:
	k = 1
	print(k)


s = input()
new = s[1:-1]
out = set()
for i in new:
	if i >= 'a' and i <= 'z':
		out.add(i)
print(len(out))


s = input()
l = []
count = 0
for i in s:
	if i >= 'a' and i <= 'z':
		if i not in l:
			l.append(i)
			count += 1
print(count)


sett = input()
listt = []
for i in sett:
	listt.append(i)
answer = 0
dic = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for i in dic:
	if i in listt:
		answer = answer + 1
print(str(answer))


print(len(set(filter(lambda x: x != '', input()[1:-1].split(', ')))))


s = input()
si = set(s)
try:
	si.remove('{')
	si.remove('}')
	si.remove(',')
	si.remove(' ')
except:
	pass
print(len(si))


s = input()
s = s[1:len(s) - 1]
s = s.split(', ')
a = []
for i in s:
	if i == '' or i == ' ':
		continue
	if i not in a:
		a.append(i)
print(len(a))


input_array = input().replace('{', '').replace('}', '').replace(' ', '').split(',')
counter_set = {}
for x in input_array:
	if x == '':
		break
	counter_set[x] = 1
print(len(counter_set))


s = input()
l = []
for i in range(len(s)):
	if s[i] == ' ' or s[i] == ',' or s[i] == '{' or (s[i] == '}'):
		continue
	else:
		l.append(s[i])
print(len(set(l)))


def main():
	inp = input()
	s = 'abcdefghijklmnopqrstuvwxyz'
	c = 0
	for i in range(len(s)):
		if inp.find(s[i]) > 0:
			c += 1
	print(c)
main()


a = input()
if a == '{}':
	print(0)
else:
	k = set()
	for l in a:
		if l.isalpha() == True:
			k.add(l)
	print(len(k))


a = input().split(', ')
b = a[0]
a[0] = b[1]
c = a[-1]
a[-1] = c[0]
a.sort()
x = 0
y = 1
z = 1
while len(a) <= 1000 and y < len(a):
	if a[x] == a[y]:
		y = y + 1
	else:
		z = z + 1
		x = y
		y = y + 1
if '}' in a:
	z = 0
print(z)


dct = input()
lst = []
for char in dct:
	if char.isalpha():
		lst.append(char)
print(len(set(lst)))


l = input().strip('{').strip('}').split(', ')
m = []
for i in l:
	if i not in m:
		m.append(i)
if m[0] == '':
	m = []
print(len(m))


s = input()
st = set()
count = 0
for i in range(1, len(s)):
	if i == 1:
		if s[1] != '}':
			st.add(s[i])
	if count == 3:
		st.add(s[i])
		count = 0
	count += 1
print(len(st))


n = input()
f = []
for i in n:
	if i == '{' or i == ',' or i == '}' or (i == ' '):
		continue
	elif i not in f:
		f.append(i)
print(len(f))


n = input()
n = n.replace('{', '')
n = n.replace('}', '')
n = n.replace(' ', '')
n = n.split(',')
n = list(set(n))
if len(n) == 1 and n[0] == '':
	print(0)
else:
	print(len(n))


s = input()
cntList = [0] * 26
for c in s:
	if 'a' <= c <= 'z':
		cntList[ord(c) - ord('a')] += 1
cnt = 0
for i in range(26):
	if cntList[i] > 0:
		cnt += 1
print(cnt)


a = input()
j = 0
s = [0 for x in range(0, 27)]
for i in a:
	if i.isalpha():
		s[ord(i) - 97] += 1
for x in s:
	if x != 0:
		j += 1
print(j)


n = input()
e = n.replace(' ', '')
f = e.replace('{', '')
g = f.replace('}', '')
if len(set(g)) > 1:
	print(len(set(g)) - 1)
else:
	print(len(set(g)))


import re
x = input()
x = re.findall("[\\w']+", x)
y = set(x)
print(len(y))


def main():
	inp = input()
	n = len(inp) // 3
	if n == 0:
		print(0)
	else:
		s = []
		for i in range(n):
			if inp[1 + 3 * i] not in s:
				s.append(inp[1 + 3 * i])
		print(len(s))
main()


s = input()
arr = set()
for x in s:
	if x == '{' or x == '}' or x == ' ' or (x == ','):
		continue
	else:
		arr.add(x)
print(len(arr))


n = input()
t = ''
if len(n) > 2:
	for i in range(1, len(n), 3):
		if n[i] not in t:
			t += n[i]
print(len(t))


import math

def solve(arr):
	result = ''
	count = 0
	for i in range(len(arr)):
		if arr[i].strip() not in result:
			result += arr[i].strip()
			count += 1
	return count
arr = input().lstrip('{').rstrip('}').split(',')
result = solve(arr)
print(result)


s = str(input())
b = []
for i in range(1, len(s)):
	if s[i] == '}':
		break
	elif s[i] == ' ' or s[i] == ',':
		continue
	b.append(s[i])
print(len(set(b)))


letters = input()[1:-1].split(', ')
dict = {}
for i in range(len(letters)):
	if letters[i].isalpha() and letters[i] not in dict:
		dict[letters[i]] = 1
print(len(dict.keys()))


recebe = input()
guarda = []
for i in recebe:
	if i.isalpha():
		guarda.append(i)
final = []
for j in guarda:
	if not j in final:
		final.append(j)
print(len(final))


n = set(input())
n.discard('{')
n.discard('}')
n.discard(' ')
n.discard(',')
print(len(n))


arr = list(input())
lst = set()
for i in arr:
	if i.isalpha():
		lst.add(i)
print(len(lst)) if len(lst) else print(0)


s = len(set(input())) - 4
if s < 0:
	s += 2
print(s)


from sys import stdin, stdout
import re
letter_set = set([x for x in re.split('[{}, \n\r]', stdin.read())])
print(len(letter_set) - 1)


set_letters = set(input().replace('}', '').replace('{', '').split(', '))
if list(set_letters)[0] != '':
	print(len(set_letters))
else:
	print(0)


x = input()
L = []
for i in range(len(x) // 3):
	if x[3 * i + 1] not in L:
		L.append(x[3 * i + 1])
print(len(L))


import re
s = input()
print(len(set(filter(lambda a: a != '', re.sub('[{}, ]', ' ', s).split(' ')))))


x = input()
l = []
for i in x:
	if i.isalpha() == True:
		l.append(i)
print(len(list(set(l))))


arr = input()
arr = arr[1:len(arr) - 1]
if len(arr) == 0:
	print(0)
	exit()
arr = arr.split(', ')
print(len(set(arr)))


s = input()
count = 0
for x in range(26):
	ch = chr(x + 97)
	if s.find(ch) != -1:
		count = count + 1
	else:
		count = count
print(count)


a = input()
l = []
for i in a:
	if ord(i) <= 122 and ord(i) >= 97:
		if i not in l:
			l.append(i)
print(len(l))


a = list(input().split())
b = []
for i in a:
	for j in i:
		if j not in b:
			b.append(j)
if ',' in b:
	print(len(b) - 3)
else:
	print(len(b) - 2)


import re
var = len(set(list(re.sub('[^a-z]', '', input()))))
print(var)


s = set(input())
flag = 0
for i in s:
	if i == ',':
		flag = 1
if flag == 1:
	print(len(s) - 4)
elif len(s) == 2:
	print(0)
else:
	print(len(s) - 2)


from sys import stdout
stdout.write(str(len(set(input() + ', ')) - 4))


_ = list(input())[1:-1:3]
print(len(set(_)))


ls = []
k = input().split()
k = ''.join(k)
k = k.split(',')
k = ''.join(k)
for i in range(1, len(k) - 1):
	ls.append(k[i])
print(len(set(ls)))


s = str(input())
p = []
for i in s:
	if ['{', '}', ',', ' '].count(i) == 0:
		p.append(i)
print(len(list(set(p))))


s = input()
w = list()
for i in s:
	if i >= 'a' and i <= 'z':
		w.append(i)
w = set(w)
print(len(w))


Set = input()[1:-1]
Set = set(Set.split(', '))
if '' in Set:
	print(len(Set) - 1)
else:
	print(len(Set))


s = input()
s1 = ''
for i in s:
	if i >= 'a' and i <= 'z':
		s1 += i
print(len(set(s1)))


a = set(''.join(list(input())[1:-1]).split(', '))
if list(a)[0] == '':
	print(0)
else:
	print(len(a))


a = input()
b = ''
for i in range(len(a)):
	if a[i] == ',' or a[i] == '{' or a[i] == '}' or (a[i] == ' '):
		continue
	else:
		b += a[i]
print(len(set(b)))


n = input()
n = n.lstrip('{')
n = n.rstrip('}')
if len(n) == 0:
	print(0)
	exit(0)
tmp = {str(tmp) for tmp in n.split(', ')}
print(len(tmp))


set1 = input()
yo = []
for i in set1:
	if i != '{' and i != '}' and (i != ',') and (i != ' '):
		if i not in yo:
			yo.append(i)
print(len(yo))


s = input()
a = s[1:-1]
lst = []
for i in a:
	if i != ',' and i != ' ':
		lst.append(i)
print(len(list(set(lst))))


list1 = list(input())
list2 = []
counter = 0
for i in list1:
	if i in 'abcdefghijklmnopqrstuvwxyz':
		if i in list2:
			continue
		else:
			list2.append(i)
			counter += 1
print(counter)


a = list(input())
a.pop()
a.pop(0)
c = []
for i in range(len(a)):
	if ord(a[i]) in range(97, 123):
		c.append(a[i])
m = len(c)
for i in range(len(c)):
	x = c.pop()
	if x in c:
		m -= 1
print(m)


w = input()
s = w[1:-1]
ne = ' ' + s
ll = list(ne.split(','))
l = list(set(ll))
if ' ' in l:
	l.remove(' ')
print(len(l))


s = input()
if s == '{}':
	print(0)
else:
	a = s[1:len(s) - 1]
	ans = set(list(a.split(', ')))
	print(len(ans))


a = input()
a = a.strip(',')
b = list(a)
b.sort()
c = 0
for i in range(len(b)):
	if b[i] != '{' and b[i] != '}' and (b[i] != ',') and (b[i] != ' '):
		if b[i] != b[i - 1]:
			c += 1
print(c)


import sys
data_in_string = str(input()).replace(' ', '')
len_symbols = len(data_in_string)
if len_symbols <= 2:
	answer = 0
else:
	numbers = list(map(str, data_in_string[1:len_symbols - 1].split(',')))
	unique_numbers = list(set(numbers))
	answer = len(unique_numbers)
print(answer)


x = list(input())
y = set(x)
count = 0
for i in y:
	if i <= 'z' and i >= 'a':
		count += 1
print(count)


s = set(input())
n = 0
for c in s:
	n += 1 if c.isalpha() else 0
print(n)


try:
	s = input()
	s = s[1:len(s) - 1].split(', ')
	ans = 0
	for (index, value) in enumerate(s):
		if value == '':
			s[index] = None
		else:
			j = index + 1
			while j < len(s):
				if s[j] == value and s[j] != None:
					s[j] = None
				j += 1
	for i in s:
		if i != None:
			ans += 1
	print(ans)
except EOFError as e:
	pass


w = input()
if w == '{}':
	print(0)
else:
	print(len(set([i.strip() for i in w[1:-1].split(',')])))


import re
inp = input()
m = re.findall('[a-z]', inp)
print(len(set(m)))


text = list(input())
text2 = []
for i in text:
	if i.isalpha():
		text2.append(i)
print(len(set(text2)))


s = input()
x = []
for i in range(0, len(s), 1):
	if s[i] != '{' and s[i] != ' ' and (s[i] != ',') and (s[i] != '}'):
		x.append(s[i])
a = []
for i in x:
	if i not in a:
		a.append(i)
print(len(a))


a = input()
res = []
for i in a:
	if i == '{' or i == '}' or i == ',' or (i == ' '):
		continue
	if i not in res:
		res.append(i)
print(len(res))


s = input()
s = s[1:]
s = s[:len(s) - 1]
s = s.replace(',', '')
s = s.replace(' ', '')
count = 0
for i in range(len(s)):
	try:
		s = s.replace(s[0], '')
		count += 1
	except IndexError:
		break
print(count)


import re

def main():
	a = set(re.findall('\\w', input()))
	print(len(a))
main()


set_ = set(input() + ', ')
k = len(set_) - 4
print(k)


letter = input()
refer = 'qwertyuioplkjhgfdsazxcvbnm'
alph = []
for i in range(len(letter)):
	if letter[i] in refer:
		alph.append(letter[i])
alph1 = set(alph)
a = len(alph1)
print(a)


N = [list(input())]
N = N[0]
M = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for (index, item) in enumerate(N):
	if item == ',':
		del N[index]
N.remove('{')
N.remove('}')
icount = 0
for i in M:
	if N.count(i) > 0:
		icount += 1
print(icount)


x = list(input())
count = 0
for i in range(26):
	if chr(ord('a') + i) in x:
		count += 1
print(count)


inp = input()
a = map(str, inp.strip('{').strip('}').split(', '))
b = set(a)
if inp == '{}':
	print('0')
else:
	print(len(b))


s = input()
li = []
for i in s:
	if i == ',' or i == '{' or i == '}' or (i == ' '):
		continue
	else:
		li.insert(0, i)
print(len(set(li)))


S = input()
k = len(S)
S1 = {S[i] for i in range(k) if S[i] != ' ' and S[i] != ',' and (S[i] != '{') and (S[i] != '}')}
print(len(S1))


l = str(input())
length = len(l)
if length == 2:
	print(0)
else:
	s = l[1:length - 1].split(', ')
	t = set(s)
	print(len(t))


list1 = input()
if list1 != '{}':
	list1 = list1[1:-1]
	list2 = list1.split(', ')
	total = len(list2)
	list3 = list(list2)
	for i in list3:
		n = list2.count(i)
		if n != 0:
			total -= n - 1
		k = str(i)
		for item in list3:
			if item in list2:
				if item == k:
					list2.remove(item)
	print(total)
else:
	print('0')


S = input()
k = 0
l = {x for x in S}
k = len(l) - 4
if len(l) == 2:
	k = 0
if len(l) == 3:
	k = 1
print(k)


s = input()
l = []
for i in s:
	if i != '{' and i != '}' and (i != ',') and (i != ' '):
		if i not in l:
			l.append(i)
print(len(l))


a = set(input())
b = []
c = 0
for i in a:
	if i == '{' or i == '}' or i == ' ' or (i == ','):
		continue
	if i not in b:
		b.append(i)
		c = c + 1
print(c)


def func(n):
	l = set()
	for i in n:
		if i.isalpha():
			l.add(i)
	print(len(l))
n = input()
func(n)


a = input()[1::3]
b = []
for i in range(0, len(a)):
	if a[i] not in b and a[i] != '}':
		b.append(a[i])
print(len(b))


letters = input()
letters = letters.replace('{', '').replace('}', '').replace(' ', '').replace(',', '')
print(len(set(letters)))


def solution(s):
	a = set()
	b = s[1:len(a) - 1].split(', ')
	for i in b:
		a.add(i)
	return len(a) if s != '{}' else 0
n = input()
print(solution(n))


string = input()
letters = string.replace('{', '').replace('}', '').strip().split(', ')
l = set(letters)
z = len(l)
if l == {''}:
	z = 0
print(z)


s = input()
liters = []
for i in s:
	if i not in ['{', '}', ',', ' ']:
		if i not in liters:
			liters.append(i)
print(len(liters))


s = input()[1:-1].split(', ')
a = []
for i in s:
	if i not in a:
		a.append(i)
print([len(a), 0]['' in s])


l = input().replace(',', '')
l = list(l.replace(' ', ''))
l = l[1:len(l) - 1]
a = []
for char in l[:]:
	if char not in a:
		a.append(char)
print(len(a))


n = input()
a = z = list(n)
count = 0
for i in set(a):
	if i.isalpha() == True:
		count += 1
print(count)


n = input()
l = []
i = 1
if len(n) > 2:
	while i < len(n):
		l.append(n[i])
		i += 3
	print(len(set(l)))
else:
	print(0)


s = input()
a = set()
for c in s:
	if c.isalpha():
		a.add(c)
print(len(a))


s = input()
a = list(set(list(s)))
c = 0
for i in range(len(a)):
	if a[i] != '}' and a[i] != '{' and (a[i] != ',') and (a[i] != ' '):
		c += 1
print(c)


a = input()
a = a.lstrip('{')
a = a.rstrip('}')
if len(a) == 0:
	print('0')
else:
	l = a.split(', ')
	s = set(l)
	print(len(s))


list = list(input())
list.pop(0)
list.pop(-1)
set = {x for x in list if x not in ' ,'}
print(len(set))


p = input()
letters = p[1:-1]
letters = letters.split(', ')
checked = []
for i in letters:
	if i != '' and i not in checked:
		checked.append(i)
print(len(checked))


s = input()
ind_letters = 0
num_letters = 0
letters = []
for i in range(len(s)):
	if ord(s[i]) >= 97 and ord(s[i]) <= 122:
		letters.append(ind_letters)
		letters[ind_letters] = s[i]
		ind_letters += 1
letters = sorted(letters)
if len(letters) > 0:
	num_letters = 1
	for i in range(1, ind_letters):
		if letters[i] != letters[i - 1]:
			num_letters += 1
print(num_letters)


s = list(input())
del s[0]
del s[-1]
a = []
for i in range(len(s)):
	if not s[i] in a:
		a.append(s[i])
if ',' in a:
	print(len(a) - 2)
else:
	print(len(a))


s = set(input().strip('{}').split(', '))
if '' in s:
	s.remove('')
print(len(s))


a = set(str(input())[1:-1:3])
print(len(a))


s = input()[1:-1]
s = s.split(',')
s = [u.strip() for u in s]
print(len(set(''.join(s))))


N = input()
n = N[1:len(N) - 1]
if len(n):
	s = set(n.split(', '))
	print(len(s))
else:
	print(0)


x = input()
y = list(x)
y = set(y)
y = list(y)
if y.count(' ') == 1:
	y.remove(' ')
y.remove('{')
y.remove('}')
if y.count(',') == 1:
	y.remove(',')
print(len(y))


def EliminarLLaves(L):
	A = ''
	for k in L:
		if str(k) != '{' and str(k) != '}':
			A += k
	return A
L = input()
a = EliminarLLaves(L)
if len(a) > 0:
	a += ','
a = a.split()
B = list(set(a))
print(len(B))


string = input()
a = []
for i in string:
	if i != '{' and i != '}' and (i != ',') and (i != ' '):
		if i not in a:
			a.append(i)
print(len(a))


n = list(input())
n.pop(-1)
n.pop(0)
if len(n) == 0:
	print(0)
elif len(n) == 1:
	print(1)
else:
	n = set(n)
	print(len(n) - 2)


a = input()
i = 97
t = []
while i <= 122:
	if chr(i) in a:
		t.append(chr(i))
	i += 1
print(len(t))


s = input()
s1 = []
for i in s:
	if i != ',' and i != '}' and (i != '{') and (i != ' '):
		s1.append(i)
print(len(set(s1)))


aSet = set(tuple((str(x) for x in input()[1:-1:3])))
print(len(aSet))


s = input()
n = len(s)
k = []
i = 1
while i < n - 1:
	d = 0
	if s[i] == ' ' or s[i] == ',':
		d = 1
		temp = s[i]
	elif s[i] != ' ' and s[i] != ',':
		j = 0
		while j < len(k):
			if s[i] == k[j]:
				d = 1
			j = j + 1
	if d == 0:
		k.append(s[i])
	i = i + 1
print(len(k))


alphabet = 'abcdefghijklmnopqrstvuwxyz'
array = []
str = input()
s = ''
for i in range(len(str)):
	if alphabet.count(str[i]) > 0:
		s += str[i]
ff = 0
used = []
count = 0
for i in range(len(s)):
	if used.count(s[i]) > 0:
		continue
	for j in range(len(s)):
		if s[i] == s[j]:
			count = count + 1
	if count == 1:
		ff = ff + 1
	else:
		ff = ff + 1
		used.append(s[i])
print(ff)


st = input()
if len(st) == 2:
	print(0)
else:
	st = st[1:-1]
	st = set(st.split(', '))
	print(len(st))


import string

def main():
	anton_set = input()
	letters = list(string.ascii_lowercase)
	counter = 0
	for item in anton_set:
		if item in letters:
			counter += 1
			letters.remove(item)
	print(counter)
main()


a = input()
b = set(a)
c = len(b) - 4
if c != -2 and c != -1:
	print(c)
if c == -2:
	print(0)
if c == -1:
	print(1)


s = input()
s = s.replace('{', '').replace('}', '').replace(',', '').replace(' ', '')
print(len(set((x for x in s))))


A = [i for i in input()]
A = list(set(A))
if len(A) >= 4:
	print(len(A) - 4)
elif len(A) == 2:
	print(0)
else:
	print(1)


n = input()
m = n[1:len(n) - 1]
l = m.split(', ')
cpy = l.copy()
for i in cpy:
	if not i:
		l.remove(i)
l = set(l)
print(len(l))


string = input()
if len(string) == 2:
	print(0)
else:
	string = string[1:-1]
	string = string.split(', ')
	string = set(string)
	print(len(string))


s = input()
s = s[1:len(s) - 1]
Q = {}
for item in s:
	if item < 'a' or item > 'z':
		continue
	Q[item] = 1
print(len(Q))


from collections import Counter
a = Counter(input())
count = 0
for ch in a:
	if ch == ',' or ch == ' ' or ch == '{' or (ch == '}'):
		continue
	else:
		count += 1
print(count)


a = set(input())
b = set('{ },')
print(len(a - b))


l = input()
l = set(l)
if len(l) > 4:
	print(len(l) - 4)
else:
	print(len(l) - 2)


x = [i for i in input().strip('{').strip('}').split(', ')]
s = set(x)
output = len(s)
if s == {''}:
	output = 0
print(output)


def main(l):
	s = set()
	ignore = '{}, '
	for i in l:
		if i not in ignore:
			s.add(i)
	return len(s)

def test():
	assert main('{a, b, c}') == 3
	assert main('{b, a, b, a}') == 2
	assert main('{}') == 0
test()
l = input()
print(main(l))


n = input()
n = n[1:-1].split(',')
m = {i.strip() for i in n}
if '' in m:
	m.remove('')
print(len(m))


entrada = input()
if entrada == '{}':
	len = 0
	print(len)
else:
	entrada = entrada.replace('{', '').replace('}', '')
	entrada = entrada.split(', ')
	conjunto = set(entrada)
	print(len(conjunto))


import re
print(len(set(re.findall('\\w', input()))))


a = 0
b = 1
c = 2
d = 3
e = 4
f = 5
g = 6
h = 7
i = 8
j = 9
k = 10
l = 11
m = 12
n = 13
o = 14
p = 15
q = 16
r = 17
s = 18
t = 19
u = 20
v = 21
w = 22
x = 23
y = 24
z = 25
print(len(eval(input())))


s = input()
a = s[1:len(s) - 1].split(', ')
b = []
if s == '{}':
	print(0)
	exit()
for i in range(len(a)):
	if a[i] not in b:
		b.append(a[i])
print(len(b))


d = input()
if d == '{}':
	print('0')
else:
	d = d[1:-1]
	d = d.replace(' ', '')
	d = d.split(',')
	print(len(set(d)))


list1 = list(input())
list1.remove('{')
list1.remove('}')
while ' ' in list1:
	list1.remove(' ')
while ',' in list1:
	list1.remove(',')
list2 = []
for element in list1:
	if element not in list2:
		list2.append(element)
print(len(list2))


n = input()
if len(n) > 2:
	n = set(n[1:len(n) - 1].split(', '))
	print(len(n))
else:
	print(0)


let = input()
result = []
for x in let:
	if x.isalpha():
		if x not in result:
			result.append(x)
print(len(result))


letters = [str(e).strip() for e in input().strip('{}').split(',')]
print(len(set(letters))) if not set(letters).issubset({''}) else print(0)


a = input().replace('{', '')
if a == '}':
	print(0)
else:
	c = a.replace('}', '')
	b = set(c.split(', '))
	print(len(b))


a = input()
import sys
if a == '{}':
	print(0)
	sys.exit()
a = a[1:-1]
a = a.replace(' ', '')
a = a.split(',')
print(len(set(a)))


x = input()
a = set()
for i in x:
	if i not in '{}, ':
		a.add(i)
	else:
		pass
print(len(a))


l = input()
s = list(l)
st = set()
for i in s:
	if i != '{' and i != '}' and (i != ',') and (i != ' '):
		st.add(i)
print(len(st))


n = input('').split(', ')
unique = []
for k in range(1, len(n) - 1):
	if n[k] not in unique:
		unique.append(n[k])
b = n[0]
c = n[-1]
if b == c:
	if len(b) == 2:
		print(0)
	elif len(b) == 3:
		print(1)
else:
	d = b[1]
	e = c[0]
	for k in (d, e):
		if k not in unique:
			unique.append(k)
	print(len(unique))


l = list(set([x for x in input()[1:-1].split(', ')]))
if l == ['']:
	print(0)
else:
	print(len(l))


s = [str(i) for i in input().split(', ')]
if len(s) > 1:
	a = list(s[0])
	s[0] = a[1]
	b = list(s[-1])
	s[-1] = b[0]
	s = set(s)
	print(len(s))
else:
	c = list(s[0])
	print(len(c) - 2)


n = set(input().split(', '))
m = set()
for i in n:
	if '{}' in i:
		m.update('1')
	elif '}' in i:
		m.update(i.split('}'))
	elif '{' in i:
		m.update(i.split('{'))
	else:
		m.update(i)
print(len(m) - 1)


s = set(input())
c = 0
for i in s:
	if 97 <= ord(i) and ord(i) <= 122:
		c += 1
print(c)


L = input()
if L == '{}':
	print(0)
else:
	L = list(L)
	newL = []
	for i in range(1, len(L), 3):
		newL.append(L[i])
	newL = list(set(newL))
	print(len(newL))


a = input()
if len(a) == int(2):
	print(0)
else:
	letters = []
	for i in a:
		if ord(i) > 96 and ord(i) < 123:
			letters.append(i)
	print(len(set(letters)))


alpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
n = input()
alist = []
for i in n:
	if i in alpha:
		alist.append(i)
blist = list(set(alist))
print(len(blist))


print(len(set([i for i in input() if i not in ['', '}', '{', ',', ' ']])))


a = input().split(',')
a = ' '.join(a).split('{')
a = ' '.join(a).split('}')
a = ' '.join(a).split()
print(len(set(a)))


def main():
	str = input()
	n = 0
	letters = []
	for i in range(str.__len__() - 1):
		if str[i] == '{' or str[i] == ',' or str[i] == ' ':
			continue
		elif str[i] not in letters:
			letters.append(str[i])
	print(letters.__len__())
main()


my_list = []
text = input()
for x in text:
	if x in 'abcdefghijklmnopqrstuvwxyz':
		my_list.append(x)
my_list = set(my_list)
my_list = list(my_list)
print(len(my_list))


final_list = []
alpha = list(input())
for a in alpha:
	if a.isalpha() and a not in final_list:
		final_list.append(a)
print(len(final_list))


n = input()
lst = list(set(n[1:-1]))
if ',' in lst:
	lst.remove(',')
if ' ' in lst:
	lst.remove(' ')
st = set(lst)
print(len(st))


import re

def main():
	string = input()
	print(len(set(re.findall('[a-z]', string))))
main()


str = input().split()
a = set()
count = 0
for s in str:
	for ss in s:
		a.add(ss)
for values in a:
	if values != '{' and values != '}' and (values != ','):
		count += 1
print(count)


s = input()
l = []
import string
for i in s:
	if i in string.ascii_letters:
		l.append(i)
d = set(l)
print(len(d))


t = input()
letterList = []
for i in t:
	if i != '{' and i != '}' and (i != ',') and (i != ' '):
		letterList.append(i)
dictionary = dict()
for i in letterList:
	if i not in dictionary:
		dictionary[i] = 1
	else:
		dictionary[i] += 1
print(len(dictionary))


n = input()
n = set(n)
s = ''.join((c for c in n if c.isalnum()))
print(len(s))


n = input()
s = list(n)
b = []
for i in range(1, len(s), 3):
	b.append(s[i])
d = list(dict.fromkeys(b))
listToStr = ''.join([str(elem) for elem in d])
if listToStr.isalpha() != True:
	print(0)
else:
	print(len(d))


print(len(set((input()[1:-1] + ', ').split(', '))) - 1)


t = list(input())
u = []
for i in range(len(t)):
	if t[i] not in u:
		u.append(t[i])
if len(u) == 2 or len(u) == 3:
	print(len(u) - 2)
else:
	print(len(u) - 4)


line = input().strip()[1:-1].split(',')
char_set = set()
for char in line:
	if char.strip() is not '':
		char_set.add(char.strip())
print(len(char_set))


input_set = input()[1:-1].split(', ')
for _ in range(input_set.count('')):
	input_set.remove('')
print(len(set(input_set)))


b = input()
d = ['']
for i in b.split(', '):
	if i.strip('{}') not in d:
		d.append(i.strip('{}'))
print(len(d) - 1)


a = input()
s = set()
for i in range(len(a)):
	if a[i].islower() and a[i] not in s:
		s.add(a[i])
print(len(s))


s = set(input())
arr = []
for letter in s:
	if letter == '{' or letter == '}' or letter == ' ' or (letter == ','):
		arr.append(letter)
for i in arr:
	s.remove(i)
print(len(s))


str = input()
str = str.replace('{', '')
str = str.replace('}', '')
str = str.replace(', ', '')
numbers = dict()
count = 0
for i in str:
	if not i in numbers:
		numbers[i] = 1
		count += 1
print(count)


s = input()
l = []
for i in s[1:len(s) - 1]:
	if i == ',' or i == ' ':
		continue
	l.append(i)
print(len(set(l)))


x = input()
l = []
for i in x:
	if i != '{' and i != '}' and (i != ',') and (i != ' '):
		l.append(i)
l = set(l)
print(len(l))


s = input()
l = list(s)
b = []
for i in l:
	if i != '{' and i != '}' and (i != ',') and (i not in b):
		b.append(i)
c = len(b) - 1
if c == -1:
	print('0')
elif c == 0:
	print('1')
else:
	print(c)


a = input()
b = []
for i in range(len(a)):
	if a[i] != ' ' and a[i] != '{' and (a[i] != '}') and (a[i] != ','):
		b.append(a[i])
c = set(b)
d = list(c)
print(len(d))


N = list(input())
N.remove(N[0])
N.remove(N[len(N) - 1])
TMP = []
for _ in range(0, len(N), 3):
	if N[_] not in TMP:
		TMP.append(N[_])
print(len(TMP))


l = input()[1:-1].split(', ')
print(len(set(l)) if '' not in set(l) else 0)


n = set(input())
c = 0
for i in n:
	if i.isalpha():
		c += 1
print(c)


n = list((x for x in input()))
l = []
count = 0
for i in n:
	if i not in l:
		if ord(i) >= 97 and ord(i) <= 122:
			count = count + 1
			l.append(i)
print(count)


n = input()
if n == '{}':
	print('0')
	exit()
i = 1
j = 0
a = []
while i < len(n):
	a.append(n[i])
	i = i + 3
	j = j + 1
a = list(dict.fromkeys(a))
print(len(a))


import math
import sys

def i():
	return input()

def ii():
	return int(input())

def li():
	return input().split()

def mi():
	return list(map(int, input().split()))
s = i()
if s == '{}':
	print(0)
else:
	s = s.replace('{', '')
	s = s.replace('}', '')
	s = s.split(', ')
	s = set(s)
	print(len(s))


x = input()
l = len(x)
c = 0
f = 97
while f <= 122:
	for i in range(1, l - 1, 3):
		if ord(x[i]) == f:
			c = c + 1
			break
	f = f + 1
print(c)


s = input()
if s == '{}':
	print('0')
else:
	l = list(s)
	l.remove(l[0])
	l.remove(l[len(l) - 1])
	if len(l) == 1:
		print('1')
	else:
		for i in l:
			if i == ',':
				l.remove(i)
		k = []
		for i in l:
			if i not in k:
				k.append(i)
			else:
				pass
		print(len(k) - 1)


ip = input()
diflet = set()
if len(ip) == 2:
	print(0)
elif len(ip) == 3:
	print(1)
else:
	nip = ip[1:-1].split(', ')
	for x in nip:
		if x not in diflet:
			diflet.add(x)
	print(len(diflet))


s1 = str(input())
s = list(s1)
new = []
for i in range(0, len(s)):
	if ord(s[i]) >= 97 and ord(s[i]) <= 122:
		new.append(s[i])
print(len(set(new)))


l = input().lstrip().rstrip()
alpha = 'abcdefghijklmnopqrstuvwxyz'
d = []
for i in l:
	if i in alpha and i not in d:
		d.append(i)
print(len(d))


string = input()
lists = []
n = len(string) // 3
if n == 0:
	print('0')
else:
	for i in range(n):
		lists.append(string[1 + 3 * i])
	letters = set(lists)
	print(len(letters))


s = str(input())
l = []
for i in s:
	if i <= 'z' and i >= 'a':
		l.append(i)
l = set(l)
print(len(l))


a = input('')
b = a.split(', ')
i = 0
count = 1
lst = list()
for i in range(len(b)):
	lst.append(a[3 * i + 1])
lst.sort()
if a == '{}':
	count = 0
else:
	for i in range(len(lst)):
		if i == len(lst) - 1:
			break
		if lst[i] == lst[i + 1]:
			continue
		count = count + 1
print(count)


k = list(input())
r = ['{', '}', ',', ' ', ' ']
l = []
for i in k:
	if (i in r) == False:
		l.append(i)
print(len(set(l)))


a = input()
b = []
b = a.split(', ')
c = []
if a == '{}':
	print('0')
else:
	b[0] = b[0][-1]
	b[-1] = b[-1][0]
	for i in range(len(b)):
		if b[i] in c:
			c.append('0')
			c.remove('0')
		else:
			c.append(b[i])
	print(len(c))


s = input()
output = 0
for i in range(0, 26):
	if chr(ord('a') + i) in s:
		output += 1
print(output)


s = input()
ln = len(s)
a = set()
for i in range(ln):
	if s[i].islower():
		a.add(s[i])
res = len(a)
print(res)


whole_set = input()
n = len(whole_set)
A = []
for i in range(int(n / 3)):
	A.append(whole_set[3 * i + 1])
A = set(A)
print(len(A))


a = input()
s = set((i for i in a if i.isalpha()))
print(len(s))


inp = input().strip()
if len(inp) <= 2:
	print(0)
else:
	print(len(set([j.strip() for j in ''.join([inp[i] for i in range(1, len(inp) - 1)]).split(',')])))


str = input()
character = []
dict = {}
for item in str:
	if ord(item) >= 97 and ord(item) <= 122:
		character.append(item)
for item in character:
	if item in dict:
		dict[item] += 1
	else:
		dict[item] = 1
print(len(dict))


a = input()
a = a[a.find('{') + 1:a.find('}')]
b = set(a.split(', '))
count = 0
for i in b:
	if not i:
		break
	else:
		count += 1
print(count)


ans = set()
letters = 'abcdefghijklmnopqrstuvwxyz'
for i in input():
	if i in letters:
		ans.add(i)
print(len(ans))


n = set(input().replace('{', '').replace('}', '').replace(',', '').replace(' ', ''))
print(len(n))


N = input().split()
Arr = []
for i in range(len(N)):
	for j in range(len(N[i])):
		if N[i][j] in Arr:
			break
		elif N[i][j] in 'abcdefghijklmnopqrstuvwxyz':
			Arr.append(N[i][j])
print(len(Arr))


import sys

def data():
	return sys.stdin.readline().strip()

def sp():
	return map(int, data().split())

def l():
	return list(sp())
word = data()
temp = word.replace(',', '')
temp = temp.replace('{', '')
res = temp.replace('}', '')
res = res.replace(' ', '')
print(len(set(res)))


letters = set(input())
count = 0
for i in letters:
	if i.isalpha():
		count += 1
print(count)


n = input()
m1 = n.replace('{', '')
m2 = m1.replace('}', '')
m3 = m2.replace(',', '')
m4 = m3.replace(' ', '')
print(len(set(m4)))


s = input()
s = s.replace('{', '')
s = s.replace('}', '')
s = s.replace(',', '')
s = s.replace(' ', '')
l = list(s)
st = set(l)
print(len(st))


a = input()
a = a[1:-1:3]
s = []
for i in a:
	if i not in s:
		s.append(i)
print(len(s))


_1 = '236a'
_2 = '339a'
_3 = '266a'
_4 = '96a'
_5 = '236a'
_6 = '281a'
_7 = '546a'
_8 = '116a'
_9 = '977a'
_10 = '266b'
_11 = '110a'
_12 = '41a'
_13 = '734a'
_14 = '133a'
_15 = '467a'
_16 = '158a'
_17 = '677a'
_18 = '580a'
_19 = '344a'
_20 = '1030a'
_21 = '705a'
_22 = '318a'
_23 = '479a'
_24 = '486a'
_25 = '61a'
_26 = '405a'
_27 = '200b'
_28 = '337a'
_29 = '148a'
_30 = '228a'
_31 = '25a'
_32 = '25a'
l = list(str(input()))
for i in l:
	if i == '{' or i == '}' or i == ',' or (i == ' '):
		l.remove(i)
for i in l:
	if i == '{' or i == '}' or i == ',' or (i == ' '):
		l.remove(i)
print(len(set(l)))


from collections import Counter
s = input()[1:-1]
if s:
	s = s.split(', ')
	print(len(Counter(s)))
else:
	print(0)


DEBUG_ON = 0
MOD = 998244353

def main():
	s = input()
	s = s[1:-1]
	if s == '':
		print(0)
		return
	X = s.split(', ')
	print(len(set(X)))

def dbg(*xargs):
	if DEBUG_ON:
		print(*xargs)
from collections import *
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def read_int():
	return int(input())

def read_ints():
	return list(map(int, input().split()))

def print_nums(nums):
	print(' '.join(map(str, nums)))

def YES():
	print('YES')

def Yes():
	print('Yes')

def NO():
	print('NO')

def No():
	print('No')

def fib(n):
	(a, b) = (0, 1)
	for _ in range(n):
		(a, b) = (b, a + b)
	return a

def fib_ns(n):
	assert n >= 1
	f = [0 for _ in range(n + 1)]
	f[0] = 0
	f[1] = 1
	for i in range(2, n + 1):
		f[i] = f[i - 1] + f[i - 2]
	return f

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b, a % b)

def xgcd(a, b):
	(x0, x1, y0, y1) = (0, 1, 1, 0)
	while a != 0:
		((q, a), b) = (divmod(b, a), a)
		(y0, y1) = (y1, y0 - q * y1)
		(x0, x1) = (x1, x0 - q * x1)
	return (b, x0, y0)

def modinv(a, m):
	(g, x, _) = xgcd(a, m)
	if g != 1:
		raise Exception('gcd(a, m) != 1')
	return x % m

def mod_add(x, y):
	x += y
	while x >= MOD:
		x -= MOD
	while x < 0:
		x += MOD
	return x

def mod_mul(x, y):
	return x * y % MOD

def mod_pow(x, y):
	if y == 0:
		return 1
	if y % 2:
		return mod_mul(x, mod_pow(x, y - 1))
	p = mod_pow(x, y // 2)
	return mod_mul(p, p)

def mod_inv(y):
	return mod_pow(y, MOD - 2)

def mod_div(x, y):
	return mod_mul(x, mod_inv(y))

def is_prime(n):
	if n == 1:
		return False
	for i in range(2, int(n ** 0.5) + 1):
		if n % i:
			return False
	return True

def primes(n):
	P = [True for _ in range(n + 1)]
	P[0] = P[1] = False
	for i in range(int(n ** 0.5) + 1):
		if P[i]:
			for j in range(2 * i, n + 1, i):
				P[j] = False
	return P
main()


str = input()
i = 'a'
ans = 0
while i <= 'z':
	if str.find(i) != -1:
		ans += 1
	i = chr(ord(i) + 1)
print(ans)


m = list(input())
li = []
for i in m:
	if i not in li:
		li.append(i)
if len(li) == 2:
	print('0')
elif len(li) == 3:
	print('1')
else:
	s = len(li) - 4
	print(s)


p = set(input().strip('{}').split(', '))
print(len(p) - 1 if '' in p else len(p))


b = str(input())
b = b.replace('{', '')
b = b.replace('}', '')
b = b.replace(',', '')
b = b.replace(' ', '')
print(len(set(b)))


n = list(input()[1:-1].split(', '))
if '' in n:
	n.remove('')
res = []
[res.append(x) for x in n if x not in res]
print(len(res))


s = input()
lst = []
for i in s:
	if i != '{' and i != ',' and (i != '}') and (i != ' '):
		lst.append(i)
print(len(set(lst)))


line1 = input()
line1.split()
if ',' in line1:
	print(len(set(line1)) - 4)
else:
	print(len(set(line1)) - 2)


s = list(input())
res = list(filter(lambda x: x.isalpha(), s))
print(len(set(res)))


words = input()
d = set()
pwords = words[1:len(words) - 1].split(', ')
for word in pwords:
	d.add(word)
if d != {''}:
	print(len(d))
else:
	print(0)


print(len(set([x.strip() for x in input().strip()[1:-1].strip().split(',') if x != ''])))


n = list(input()[1:-1].split(', '))
if n == ['']:
	print(0)
else:
	print(len(set(n)))


s = input()
ans_list = []
for i in s:
	if i != '{' and i != '}' and (i != ',') and (i != ' ') and (i not in ans_list):
		ans_list.append(i)
print(len(ans_list))


string = input()[1:-1].split(',')
print(len(set(''.join(string).split())))


string = input()
b = []
count = 0
for i in range(len(string)):
	if string[i] >= 'a' and string[i] <= 'z':
		if string[i] not in b:
			count = count + 1
			b.append(string[i])
print(count)


x = input()
if x == '{}':
	print(0)
	exit()
y = x.split(',')
y[0] = ' ' + y[0][1]
y[len(y) - 1] = y[len(y) - 1][:2]
c = dict()
for x in y:
	c[x.strip()] = c.get(x.strip(), 1)
z = len(c)
print(z)
exit()


l = {}
s = input()[1:-1].split(',')
for i in s:
	i = i.strip()
	if i not in l and i != '':
		l[i] = 1
print(str(len(l)))


def main():
	s = input()[1:-1]
	if not s:
		print(0)
	else:
		print(len(set([x.strip() for x in s.split(',')])))
main()


string = str(input())
arr2 = []
for i in string:
	if i != '{' and i != '}' and (i != ',') and (i != ' '):
		if i not in arr2:
			arr2.append(i)
print(len(arr2))


a = list(input())
a.remove('{')
a.remove('}')
a = ''.join(a)
a = a.split(', ')
if '' in a:
	a.remove('')
listy = []
count = 0
for i in a:
	if i not in listy:
		listy.append(i)
for i in listy:
	count += 1
print(count)


line = set(input())
line.discard('}')
line.discard('{')
line.discard(' ')
line.discard(',')
print(len(line))


st = input()
s = set()
i = 1
while i < len(st) - 1:
	s.add(st[i])
	i = i + 3
print(len(s))


res = []
for i in input():
	if i.isalpha():
		res.append(i)
print(len(set(res)))


ans = set(input()[1:-1].split(', '))
if ans == {''}:
	print(0)
else:
	print(len(ans))


Letter = input()
list1 = []
for l in Letter:
	if l.isalpha():
		if l not in list1:
			list1.append(l)
		else:
			continue
print(len(list1))


lista = input()
lista1 = []
for x in lista:
	if x != ' ' and x != ',' and (x != '{') and (x != '}') and (x not in lista1):
		lista1.append(x)
print(len(lista1))


s = list(map(str, input()))
alphabet = 'qwertyuiopasdfghjklzxcvbnm'
s1 = []
for i in range(len(s)):
	if s[i] in alphabet:
		s1.append(s[i])
counter = 0
temp = []
for j in range(len(s1)):
	if s1[j] not in temp:
		counter += 1
		temp.append(s1[j])
print(counter)


s = input().replace(' ', '')
p = len(set(s))
if p == 2:
	print(0)
elif p == 3:
	print(1)
else:
	print(p - 3)


lst = input()
dist = []
for i in lst:
	if i.isalpha() and i not in dist:
		dist.append(i)
print(len(dist))


s = input()
p = []
for i in range(1, len(s) + 1):
	if not (s[i - 1] == '{' or s[i - 1] == ',' or s[i - 1] == ' ' or (s[i - 1] == '}')):
		p.append(s[i - 1])
x = len(set(p))
print(x)


s = input()
a = []
for i in range(len(s)):
	if s[i] == ' ' or s[i] == '{' or s[i] == '}' or (s[i] == ','):
		continue
	a.append(s[i])
ans = set(a)
print(len(ans))


s = input().split(' ')
count = [False] * 27
if len(s[0]) > 2:
	for i in range(len(s)):
		if i == 0:
			count[ord(s[i][1]) - 96] = True
		else:
			count[ord(s[i][0]) - 96] = True
print(sum(count))


y = input()
z = []
for i in y:
	if ord(i) >= 97 and ord(i) <= 122:
		z.append(i)
print(len(list(set(z))))


s = []
a = input()
if len(a) > 2:
	for i in range(1, len(a), 3):
		s.append(a[i])
else:
	s = []
m = set(s)
print(len(m))


n = input()
a = list(n)
b = []
count = 0
for i in range(0, len(a)):
	if a[i] != ' ' and a[i] != ',' and (a[i] != '{') and (a[i] != '}'):
		if a[i] not in b:
			b.append(a[i])
			count += 1
print(count)


letter = str(input())
letter = letter.replace('{', ' ').rstrip('}')
word_list = letter.split(',')
word_list.sort()
word_list.append(' ')
j = 0
i = 0
while i < len(word_list) - 1:
	if word_list[i] != word_list[i + 1]:
		i = i + 1
		j = j + 1
	else:
		i = i + 1
print(str(j))


a = input()
n = set()
for i in range(len(a)):
	if a[i] >= 'a' and a[i] <= 'z':
		n.add(a[i])
print(len(n))


n = input()
lst = []
for i in range(1, len(n) - 1):
	if n[i] == ',' or n[i] == ' ':
		continue
	lst.append(n[i])
print(len(set(lst)))


s = input()
s = ''.join(filter(str.isalpha, s))
unique = set(s)
print(len(unique))


a = input()
if len(a) == 2:
	print(int(0))
elif len(a) == 3:
	print(int(1))
else:
	b = set(a)
	n = len(b)
	print(n - 4)


s = input()
s = s[1:-1]
l = s.split(', ')
d = {}
if l[0] == '':
	print(0)
else:
	for c in l:
		d[c] = 1
	print(sum(d.values()))


s = str(input())
a = []
for i in range(1, len(s), 3):
	if not s[i] in a and (not s[i] == '}'):
		a.append(s[i])
print(len(a))


s = input()
s = s[1:len(s) - 1]
if len(s) == 0:
	print('0')
else:
	l = list(map(str.strip, s.split(',')))
	x = set(l)
	print(len(x))


m = []
a = str(input())
for i in range(len(a)):
	if a[i] != '{' and a[i] != '}' and (a[i] != ' ') and (a[i] != ','):
		if m.count(a[i]) == 0:
			m.append(a[i])
print(len(m))


x = input()
x = x[1:len(x) - 1].split(', ')
i = 0
k = 0
while i < len(x):
	if x.count(x[i]) > 0 and x[i].isalpha() == True:
		x = [z.replace(x[i], '') for z in x]
		k += 1
	i += 1
print(k)


import re

def inarr(word, arr2):
	for i in arr2:
		if i == word:
			return True
	return False

def main():
	line = input()
	arr = re.findall('[a-z]', line)
	arr2 = []
	curr = 0
	for i in range(0, len(arr)):
		if not inarr(arr[i], arr2):
			arr2.append(arr[i])
			curr += 1
	print(curr)
main()


s = input()
b = []
a = 0
for i in s:
	if i == ' ' or i == ',' or i == '{' or (i == '}'):
		continue
	elif not i in b:
		b.append(i)
		a += 1
print(a)


def main():
	s = list(input().split(','))
	if s == ['{}']:
		print(0)
	elif len(s) == 1:
		print(1)
	else:
		s1 = str(s[0])
		s.remove(s[0])
		s2 = list(s1.split('{'))
		s3 = str(s[len(s) - 1])
		s.remove(s[len(s) - 1])
		s4 = list(s3.split('}'))
		s = s2 + s + s4
		s5 = []
		for i in s:
			if i.strip() not in s5 and i != '':
				s5.append(i.strip())
		print(len(s5))
main()


a = input()
count = 0
letter = []
for i in range(1, len(a) - 1, 3):
	letter.append(a[i])
for i in range(0, len(letter)):
	for j in range(i + 1, len(letter)):
		if letter[i] == letter[j]:
			count += 1
			break
print(len(letter) - count)


r = list(input())
del r[0]
del r[-1]
r = ''.join(r)
if len(r) == 0:
	print('0')
elif len(r) == 1:
	print('1')
else:
	r = ''.join(r.split(', '))
	n = len(r)
	s = [r[0]]
	total = 1
	for i in range(1, n):
		if r[i] in s:
			pass
		else:
			s.append(r[i])
			total = total + 1
	print(total)


s = set(input())
t = {'{', '}', ' ', ','}
print(len(s.difference(t)))


i = set(input())
if ' ' in i:
	i.remove(' ')
if ',' in i:
	i.remove(',')
i.remove('{')
i.remove('}')
print(len(i))


print(len(set((ch for ch in input() if ch.isalpha()))))


def anton():
	instr = input()
	instr = instr.strip('{')
	instr = instr.strip('}')
	instr = instr.replace(' ', '')
	if instr == '':
		print(0)
	else:
		lst = instr.split(',')
		lst2 = set(lst)
		print(len(lst2))
anton()


mas = input()
b = []
for i in mas:
	if i != ' ' and i != '{' and (i != '}') and (i != ','):
		b.append(i)
b = set(b)
print(len(b))


s = input()
if s == '{}':
	print(0)
else:
	s = s[1:-1]
	l = list(s.split(', '))
	print(len(set(l)))


import string
t = list(string.ascii_lowercase)
ans = set()
for i in input():
	if i in t:
		ans.add(i)
print(len(ans))


s = input()
brackets = ('{', '}', ',', ' ')
arr = []
for i in s:
	if i in brackets:
		s = s.replace(i, '')
for i in s:
	arr.append(i)
x = set(arr)
print(len(x))


n = input()
t = 0
if n == '{}':
	print(0)
	t = 1
n = n.replace('{', '')
n = n.replace('}', '')
n = n.split(', ')
n = set(n)
if t == 0:
	print(len(n))


string = input()
string = string[1:]
string = string[:len(string) - 1]
letras = list(string.split(', '))
if letras == ['']:
	print(0)
else:
	diccionario = {}
	for letra in letras:
		if letra not in diccionario:
			diccionario[letra] = 1
	resultado = 0
	print(len(diccionario))


s = set(input().strip('{}').split(', '))
s.discard('')
print(len(s))


n = input()
if n == '{}':
	print(0)
else:
	r = set()
	for x in n:
		if x.isalpha():
			r.add(x)
	print(len(r))


seT = list(map(str, input().strip('{').strip('}').replace(',', '').split()))
print(len(set(seT)))


n = input()
l = list(n)
l2 = []
distinct = 0
if len(l) < 3:
	print(0)
	quit()
for i in range(1, len(l), 3):
	if l[i] not in l2 and str([l]):
		l2.append(l[i])
		distinct += 1
print(distinct)


s = input()
arr = []
for i in range(len(s)):
	if s[i] != '{' and s[i] != '}' and (s[i] != ',') and (s[i] != ' '):
		arr.append(s[i])
list = []
for i in range(len(arr)):
	list.append(ord(arr[i]))
list.sort()
res = []
for i in list:
	if i not in res:
		res.append(i)
print(len(res))


n = list(input())
d = set()
for i in n:
	if ord(i) < 123 and ord(i) > 96:
		d.add(i)
print(len(d))


import string
s = input()
k = []
for i in s:
	if i not in k and i in 'abcdefghijklmnopqrstuvwxyz':
		k.append(i)
print(len(k))


line = input()
if len(line) > 2:
	line = line[1:-1]
	chars = set(line.split(', '))
	print(len(chars))
else:
	print(0)


a = input()
ans = set()
for i in a:
	if i != ',' and i != ' ' and (i != '{') and (i != '}'):
		ans.add(i)
print(len(ans))


a = input()
l = [i for i in a if i.isalpha()]
print(len(set(l)))


Set = input().strip('{}').split(', ')
if '' in Set:
	Set.remove('')
print(len(set(Set)))


x = list(map(str, input()))
c = set()
for i in x:
	if i.isalpha():
		c.add(i)
print(len(c))


s = list(set(input()))
c = len(s)
if c == 2:
	print('0')
elif c == 3:
	print('1')
else:
	print(str(c - 4))


m = input()
real = []
k = str(m)
p = list(k)
for i in range(len(p)):
	if p[i] != '{' and p[i] != '}' and (p[i] != ',') and (p[i] != ' '):
		real.append(p[i])
new = []
for j in range(len(real)):
	if real[j] not in new:
		new.append(real[j])
print(len(new))


a = input()
a = set(a)
a = [i for i in a if i != '{' and i != ',' and (i != ' ') and (i != '}')]
print(len(a))


a = input()
a = a[1:-1]
a = a.split(', ')
d = {}
n = 0
for i in range(len(a)):
	if a[i] not in d and a[i] != '':
		n += 1
		d[a[i]] = i
print(n)


c = 0
s = input()[1:-1].split(',')
p = ''
for i in s:
	if i.strip() not in p:
		p += i.strip()
		c += 1
print(c)


a = input().strip()
s = set()
for i in a:
	if i.islower():
		s.add(i)
print(len(s))


a = []
for l in input():
	if l.isalpha():
		a.append(l)
print(len(list(set(a))))


string = input()
string = string.strip('{}')
letters = set((e for e in string.split(', ') if e != ''))
print(len(letters))


a = input().split(', ')
a[0] = a[0].replace('{', '')
a[-1] = a[-1].replace('}', '')
s = len(set(a))
print(0 if a[0] == '' else s)


from math import *
from copy import *
from string import *
from random import *
from sys import stdin
from sys import maxsize
from operator import *
from itertools import *
from collections import Counter
import math
s = set()
s1 = str(input())
for i in range(len(s1)):
	if s1[i:i + 1] != '{' and s1[i:i + 1] != '}' and (s1[i:i + 1] != ' ') and (s1[i:i + 1] != ','):
		s.add(s1[i:i + 1])
print(len(s))


st = input()
setst = set(st)
k = 0
for i in range(len(setst)):
	if list(setst)[i] in 'qwertyuiopasdfghjklzxcvbnm':
		k += 1
print(k)


s = input()
sets = set()
for i in s:
	if i.isalpha():
		sets.add(i)
print(len(sets))


data = set(list(input()))
data.remove('{')
data.remove('}')
data = list(data)
if len(data) > 1:
	data.remove(',')
	data.remove(' ')
print(len(data))


__author__ = 'Walnut'
import math
import copy
line = input()
arr = []
s = int(0)
for i in range(26):
	arr.append(int(0))
for c in line:
	if 'a' <= c <= 'z':
		arr[ord(c) - ord('a')] += 1
for i in arr:
	if i != 0:
		s += 1
print(s)


import re
n = input()
a = re.split(',|{|}| ', n)
b = set(a)
b.remove('')
print(len(b))


s = input()
ans = 0
for i in range(26):
	if s.count(chr(i + 97)) != 0:
		ans += 1
print(ans)


h = [s for s in input()]
ans = set()
for ele in h:
	ans.add(ele)
if len(ans) >= 5:
	print(len(ans) - 4)
elif len(ans) == 3:
	print(len(ans) - 2)
else:
	print(len(ans) - 2)


import re
text = input()
letters = re.split('{|}|, ', text)
letters.pop(0)
letters.pop(-1)
again = []
for letter in letters:
	if letter == '':
		continue
	elif letter not in again:
		again.append(letter)
print(len(again))


import math
import os
import random
import re
import sys
import time
import statistics

def swap(a, b):
	tmp = a
	a = b
	b = tmp
	return (a, b)

def fn(char):
	if not len(char):
		return 0
	else:
		return len(set(char))
d = 2
S = 5
arr1 = [[0, 1], [1, 4], [3, 5]]
arr2 = [[0, 3], [2, 4], [3, 5]]
arr3 = [[4, 6], [0, 0]]
char = list(input().split('{')[-1].split('}')[0])
char = [a for a in char if a is not ',']
char = [a for a in char if a is not ' ']
result = fn(char)
print(result)


def main():
	string = input()
	if string == '{}':
		print(0)
	else:
		print(len(list(set(string[1:-1].replace(' ', '').split(',')))))
main()


string = input()
if string == '{}':
	print(0)
else:
	string1 = str()
	dic = dict()
	for i in string:
		if i != ' ':
			string1 += i
	list = string1[1:len(string1) - 1].split(',')
	for i in range(0, len(list)):
		dic[list[i]] = 1
	print(len(dic))


s = input()
ch = set()
for i in range(len(s)):
	if s[i] >= 'a' and s[i] <= 'z':
		ch.add(s[i])
print(len(ch))


s = input().rstrip()
result = set()
for i in s:
	if i != '}' and i != '{' and (i != ' ') and (i != ','):
		result.add(i)
print(len(result))


def solve():
	s = input()
	l = []
	c = 0
	n = len(s)
	for i in range(n):
		if i == 0 or i == n - 1 or s[i] == ',' or (s[i] == ' '):
			continue
		elif s[i] not in l:
			l.append(s[i])
			c += 1
	print(c)
solve()


s = input()
if s == '{}':
	print(0)
else:
	s = s.strip('{')
	s = s.strip('}')
	s = {char for char in s.split(', ')}
	print(len(s))


s = input()
x = 'abcdefghijklmnopqrstuvwxyz'
c = 0
for t in x:
	if s.count(t) > 0:
		c = c + 1
print(c)


n = input()
l = []
for i in range(len(n)):
	if 97 <= ord(n[i]) <= 122:
		l.append(n[i])
a = set(l)
print(len(a))


from collections import defaultdict as dd

def lcm(a, b):
	return a * b // gcd(a, b)

def inin():
	return int(input())

def inar():
	return list(map(int, input().split()))

def ar(element, size):
	return [element for i in range(size)]

def digitsum(num):
	su = 0
	while num:
		su += num % 10
		num //= 10
	return su

def yes():
	print('YES')

def no():
	print('NO')

def countDivisibles(A, B, M):
	if A % M == 0:
		return B // M - A // M + 1
	return B // M - A // M

def countSetBits(n):
	count = 0
	while n:
		count += n & 1
		n >>= 1
	return count
Testcase = 1
for _ in range(Testcase):
	s = input()
	s = s[1:-1]
	if s == '':
		print(0)
		break
	arr = s.split(', ')
	print(len(set(arr)))


s = input()
frq = [0] * 26
for c in s:
	if c >= 'a' and c <= 'z':
		frq[ord(c) - ord('a')] = 1
count = 0
for f in frq:
	count += f
print(count)


str1 = input().split(',')
str1[0] = str1[0][1:]
str1[0] = ' ' + str1[0]
str1[len(str1) - 1] = str1[len(str1) - 1][0:len(str1[len(str1) - 1]) - 1]
str1 = set(str1)
if str1 == {' '}:
	print(0)
else:
	print(len(str1))


n = input()
m = []
for i in range(1, len(n), 3):
	if not n[i] in m:
		m.append(n[i])
if n == '{}':
	print(0)
else:
	print(len(m))


def main():
	letters = [letter for letter in input() if letter.isalpha()]

	def distinct_letters(letters):
		dletters = {}
		for letter in letters:
			if letter not in dletters:
				dletters[letter] = None
		return len(dletters)
	print(distinct_letters(letters))
main()


s = set(input())
s.discard('{')
s.discard('}')
s.discard(' ')
s.discard(',')
print(len(s))


t = input()
s = set(t)
s = list(s)
try:
	del s[s.index(' ')]
except:
	pass
try:
	del s[s.index('{')]
except:
	pass
try:
	del s[s.index('}')]
except:
	pass
try:
	del s[s.index(',')]
except:
	pass
print(len(s))


import string
s = input()
l = []
count = 0
for i in s:
	if i in string.ascii_lowercase and (not i in l):
		l.append(i)
		count += 1
print(count)


s = input()
s = s[1:-1]
if s == '':
	print(0)
	exit(0)
s = [x.strip() for x in s.split(',')]
print(len(set(s)))


listo = list(input()[1:-1].split(', '))
if len(listo) == 1 and listo[0] == '':
	print(0)
else:
	print(len(set(listo)))


s = input()
s = s.replace('{', '')
s = s.replace('}', '')
t = s.split(', ')
j = []
for i in t:
	if i not in j and i != '':
		j.append(i)
print(len(j))


a = input()
a = a[1:len(a) - 1]
b = [i for i in a if i.isalpha() == True]
print(len(set(list(b))))


a = list(map(str, input().split(', ')))
final_str = []
if len(a) == 1:
	if len(list(a[0])) == 2:
		print(0)
		exit()
	else:
		print(1)
		exit()
if len(a) >= 2:
	first = list(a[0])
	last = list(a[len(a) - 1])
	first.pop(0)
	last.pop(len(last) - 1)
	final_str.append(first[0])
	final_str.append(last[0])
	for i in range(1, len(a) - 1):
		final_str.append(a[i])
	print(len(set(final_str)))


string = input('')
arr = []
flag = 0
for i in range(1, len(string) - 1, 3):
	arr.append(string[i])
l1 = list(dict.fromkeys(arr))
print(len(l1))


s = input()[1:-1].split(', ')
l = len(s)
a = [0] * 26
ans = 0
for i in range(l):
	if s[i]:
		if a[ord(s[i]) - 97] == 0:
			ans += 1
			a[ord(s[i]) - 97] = 1
print(ans)


s = input()
l = []
for i in s:
	if i in 'qwertyuiopasdfghjklzxcvbnm':
		l.append(i)
print(len(set(l)))


s = list(input())
s = set(s)
ans = len(s) - 2
if ',' in s:
	ans -= 1
if ' ' in s:
	ans -= 1
print(ans)


s = input()
a = []
c = 0
for i in s:
	if i != '{' and i != '}' and (i != ',') and (i != ' '):
		a.append(i)
b = []
for i in a:
	if i not in b:
		b.append(i)
print(len(b))


n = input()
x = 0
b = []
if len(n) != 0:
	for i in n:
		if i in 'abcdefghijklmnopqrstuvwxyz' and i not in b:
			b.append(i)
print(max(x, len(b)))


def main():
	s = input()
	if s == '{}':
		print(0)
	else:
		k = list(s.lstrip('{').rstrip('}').split(', '))
		print(len(set(k)))
main()


data = input()
print(len(set(data[1:-1].split(', '))) if data != '{}' else 0)


s = input()
a = s[1:]
b = a[:-1]
z = b.split(', ')
count = 0
m = []
if s == '{}':
	pass
else:
	for i in z:
		if i in m:
			continue
		else:
			count = count + 1
			m.append(i)
print(count)


a = input().strip('{').strip('}').strip().split(',')
lis = []
for i in a:
	lis.append(i.lstrip().rstrip())
if '' in set(lis):
	res = len(set(lis)) - 1
else:
	res = len(set(lis))
print(res)


k = set(input()[1:-1].split(', '))
k.discard('')
print(len(k))


n = input()
a = list(n)
s = []
for i in n:
	if i.isnumeric() or i.isalpha():
		s.append(i)
sum_i = len(set(s))
print(sum_i)


x = input()
a = []
for i in x:
	if i.isalpha():
		if i not in a:
			a.append(i)
print(len(a))


from collections import Counter
s = input()
s = s[1:len(s) - 1]
s = s.replace(',', '')
s = s.split()
c = Counter(s)
print(len(c))


pole = input()[1:-1].split(', ')
if len(pole) == 1 and (not pole[0].isalpha()):
	print('0')
else:
	print(len(set(pole)))


b = input()
c = b[1:len(b) - 1]
c = c.replace(',', '')
c = c.replace(' ', '')
print(len(set(c)))


from collections import OrderedDict
foo = str(input())
foo = foo.replace('{', '')
foo = foo.replace('}', '')
foo = foo.replace(',', '')
foo = foo.replace(' ', '')
result = ''.join(OrderedDict.fromkeys(foo))
print(len(result))


x = input()
y = []
z = []
for i in range(len(x)):
	if ord(x[i]) >= 65 and ord(x[i]) != 123 and (ord(x[i]) != 125) and (ord(x[i]) != 44):
		y.append(x[i])
for i in range(len(y)):
	if y[i] not in z:
		z.append(y[i])
print(len(z))


listOfNumbers = input()[1:-1]
listOfNumbers = listOfNumbers.replace(' ', '').split(',')
setOfNumbers = list(set(listOfNumbers))
count = 0
for el in setOfNumbers:
	if el != '':
		count += 1
print(count)


from sys import stdout
strl = input().replace('{', '').replace('}', '').replace(',', '').split()
stdout.write(str(len(set(strl))))


a = input()
t = list(a)
if len(t) > 2:
	t.remove(t[0])
	l = len(t)
	t.remove(t[l - 1])
	b = ''.join(t)
	list = b.split(', ')
	li = []
	for i in list:
		li.append(i)
	print(len(set(li)))
else:
	print(0)


a = input()
c = ['{', ' ', ',', '}']
for i in a:
	if i not in c:
		c.append(i)
print(len(c) - 4)


input_s = input()[1:][:-1]
list_s = list([x.strip() for x in input_s.split(',') if len(x.strip()) > 0])
print(len(list(set(list_s))))


x = input()
a = 'qwertyuiopasdfghjklzxcvbnm'
b = set()
for i in x:
	if i in a:
		b.add(i)
print(len(b))


x = set(input().lstrip('{').rstrip('}').split(', '))
if x == {''}:
	print(0)
else:
	print(len(x))


from __future__ import division, print_function
import os, sys
from io import BytesIO, IOBase
import math
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def ii():
	return int(input())

def si():
	return input()

def mi():
	return map(int, input().strip().split(' '))

def msi():
	return map(str, input().strip().split(' '))

def li():
	return list(mi())

def dmain():
	sys.setrecursionlimit(1000000)
	threading.stack_size(1024000)
	thread = threading.Thread(target=main)
	thread.start()
abc = 'abcdefghijklmnopqrstuvwxyz'
abd = {'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
mod = 1000000007
inf = float('inf')
vow = ['a', 'e', 'i', 'o', 'u']
(dx, dy) = ([-1, 1, 0, 0], [0, 0, 1, -1])

def getKey(item):
	return item[1]

def sort2(l):
	return sorted(l, key=getKey, reverse=True)

def d2(n, m, num):
	return [[num for x in range(m)] for y in range(n)]

def isPowerOfTwo(x):
	return x and (not x & x - 1)

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def ntl(n):
	return [int(i) for i in str(n)]

def ncr(n, r):
	return factorial(n) // (factorial(r) * factorial(max(n - r, 1)))

def ceil(x, y):
	if x % y == 0:
		return x // y
	else:
		return x // y + 1

def powerMod(x, y, p):
	res = 1
	x %= p
	while y > 0:
		if y & 1:
			res = res * x % p
		y = y >> 1
		x = x * x % p
	return res

def gcd(x, y):
	while y:
		(x, y) = (y, x % y)
	return x

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def read():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')

def main():
	print(len(set(input() + ', ')) - 4)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


letters = [x for x in input().replace(',', '').replace('{', '').replace('}', '').split()]
count = 0
for letter in 'abcdefghijklmnopqrstuvwxyz':
	if letters.count(letter) > 0:
		count += 1
print(count)


n = input()
n = n[1:len(n) - 1]
n = n.split(',')
s = set()
for i in n:
	i = i.strip()
	s.add(i)
if n[0] == '':
	print('0')
else:
	print(len(s))


import re
inp = input('')
for st in inp:
	li = re.findall('[a-z]+', inp)
s = set(li)
print(len(s))


a = input()
k = 0
B = [0] * 26
for i in range(len(a)):
	if 122 >= ord(a[i]) >= 97:
		B[ord(a[i]) - 97] += 1
for j in range(26):
	if B[j] >= 1:
		k += 1
print(k)


a = input()
l = []
for x in a:
	l.append(x)
l.pop(0)
l.pop(-1)
b = len(set(l))
if b > 1:
	print(b - 2)
else:
	print(b)


l = list(input())
k = ['{', '}', ',', ' ']
p = []
j = 0
for i in range(len(l)):
	if l[i] not in k:
		p.append(l[i])
print(len(set(p)))


def distinctLetters(word):
	temp = '{}, '
	count = 0
	for i in word:
		if i not in temp:
			count += 1
			temp += i
	return count
word = input()
print(distinctLetters(word))


from sys import stdin, stdout, exit as sys_ret
(f_input, f_print, f_flush) = (stdin.readline, stdout.write, stdout.flush)
seq = f_input().replace('\n', '')
if seq == '{}':
	f_print('0')
	sys_ret(0)
seq = set(seq.replace('{', '').replace('}', '').replace(' ', '').split(','))
f_print(str(len(seq)))


x = input()
i = 1
cpt = 0
x = x.replace(', ', '')
while i < len(x) - 1:
	if x.count(x[i]) > 1:
		x = x.replace(x[i], '')
	else:
		i += 1
	cpt += 1
print(cpt)


def seperateints(x):
	k = ''
	l = []
	for i in x:
		if i == ' ':
			l.append(int(k))
			k = ''
			continue
		k = k + i
	l.append(int(k))
	return l

def luckynum(x):
	for i in x:
		if i != '4' and i != '7':
			return False
	return True
x = input()
kk = ''
for i in x:
	if i != '{' and i != '}' and (i != ',') and (i != ' '):
		kk = kk + i
ss = ''
for i in range(len(kk)):
	n = 0
	for k in range(len(kk)):
		if i >= k:
			continue
		if kk[i] == kk[k]:
			n += 1
	if n == 0:
		ss = ss + kk[i]
print(len(ss))


a = set(list(input()))
an = len(a)
if ' ' in a:
	an -= 1
if ',' in a:
	an -= 1
print(an - 2)


string = input()
string = list(string)
haha = []
for i in string:
	if i != '{' and i != '}' and (i != ',') and (i != ' '):
		haha.append(i)
print(len(list(set(haha))))


s = input().replace(' ', '')
s = s[1:-1]
if s == '':
	print(0)
	raise SystemExit
print(len(set(s.split(','))))


n = input()
result = set()
for i in n:
	if i.isalpha():
		result.add(i)
print(len(result))


entrada = input()
entrada = list(entrada)[1:-1]
saida = []
for i in entrada:
	if str.isalnum(i) and (not i in saida):
		saida.append(i)
print(len(saida))


str1 = str(input())
if len(str1) == 2:
	print('0')
else:
	str2 = str1[1:len(str1) - 1]
	l = str2.split(sep=', ')
	count = 0
	for i in range(len(l)):
		if l[i] in l[i + 1:]:
			count += 1
	print(len(l) - count)


s = input()
length = len(s)
se = set()
for i in range(length):
	if s[i].isalpha():
		se.add(s[i])
n = len(se)
print(n)


s = input()
s = s.replace('{', '')
s = s.replace('}', '')
if len(s) == 0:
	print('0')
else:
	s = s.split(', ')
	a_set = set()
	for c in s:
		a_set.add(c)
	print(str(len(a_set)))


letter_alpha = []
for i in input():
	if i.isalpha():
		letter_alpha.append(i)
print(len(set(letter_alpha)))


line = input()[1:-1].replace(',', '')
letters = [i for i in line.split()]
print(len(set(letters)))


n = input()
l = []
d = {}
for i in n:
	if ord(i) in range(97, 123):
		l.append(i)
for i in l:
	d[i] = 0
(print(len(d)),)


n = input()
str = n.strip('{}')
str = str.replace(' ', '')
lst = str.split(',')
if len(n) == 2:
	l = 0
else:
	l = len(lst)
i = 0
c = 0
for k in lst:
	j = 0
	for v in lst:
		if k == 0:
			break
		if v == 0:
			j = j + 1
			continue
		if k == v and i != j:
			lst[j] = 0
			c = c + 1
		j = j + 1
	i = i + 1
print(l - c)


x = input().replace(' ', '').replace(',', '').replace('{', '').replace('}', '')
y = set(x)
print(len(y))


set = input()
set = set[1:len(set) - 1]
if len(set) == 0:
	print(0)
else:
	set = set.split(', ')
	count = 0
	dict = {}
	for ch in set:
		if ch not in dict:
			dict[ch] = 1
			count += 1
	print(len(dict))


n = input()
new_n = n[1:-1]
if len(new_n) == 0:
	print(0)
else:
	final_n = new_n.split(',')
	a = final_n.pop(0)
	a = ' ' + a
	final_n.append(a)
	print(len(set(final_n)))


s = input().strip('{}')
if not len(s):
	print(0)
else:
	print(len(set(s.split(', '))))


n = input()
l = []
for i in range(1, len(n) - 1, 3):
	l.append(n[i])
se = set(l)
print(len(se))


l = list(input())
l1 = list(filter(lambda x: x.isalpha(), l))
print(len(set(l1)))


low = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
upper = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
b = []
a = input()
for i in range(len(a)):
	if a[i] in low or a[i] in upper:
		b.append(a[i])
print(len(set(b)))


a = input()
if len(a) == 2:
	print(0)
else:
	a = a[1:-1]
	a = a.split(', ')
	b = []
	for i in a:
		if i not in b:
			b.append(i)
	print(len(b))


s = input()
li = list(s)
l = len(li)
if s == '{}':
	print(0)
else:
	for i in li:
		if i == '{':
			li.remove(i)
		elif i == '}':
			li.remove(i)
		elif i == ',':
			li.remove(i)
		elif i == ' ':
			li.remove(i)
	for i in li:
		if i == ' ':
			li.remove(i)
	l1 = len(li)
	s1 = set(li)
	l2 = len(s1)
	print(l2)


def anton(s):
	alpha = 'qwertyuioplkjhgfdsazxcvbnm'
	arr = []
	for i in s:
		if i in alpha:
			arr += [i]
	count = 0
	st = ''
	for i in arr:
		if i not in st:
			st += i
	print(len(st))
s = input()
anton(s)


d = []
for i in range(26):
	d.append('abcdefghijklmnopqrstuvwxyz'[i])
n = input()
s = 0
ha = 1
for j in range(len(n)):
	if n[j] in d:
		s += 1
		d.remove(n[j])
print(s)


s = input()
if s == '{}':
	print(0)
	exit()
print(len(set(s[1:-1].split(', '))))


import sys
import math
import bisect
from sys import stdin, stdout
from math import gcd, floor, sqrt, log
from collections import defaultdict as dd
from bisect import bisect_left as bl, bisect_right as br
sys.setrecursionlimit(100000000)
ii = lambda : int(input())
si = lambda : input()
jn = lambda x, l: x.join(map(str, l))
sl = lambda : list(map(str, input().strip()))
mi = lambda : map(int, input().split())
mif = lambda : map(float, input().split())
lii = lambda : list(map(int, input().split()))
ceil = lambda x: int(x) if x == int(x) else int(x) + 1
ceildiv = lambda x, d: x // d if x % d == 0 else x // d + 1
flush = lambda : stdout.flush()
stdstr = lambda : stdin.readline()
stdint = lambda : int(stdin.readline())
stdpr = lambda x: stdout.write(str(x))
mod = 1000000007
s = si()
l = []
for char in s:
	if char == '{' or char == ',' or char == ' ' or (char == '}'):
		continue
	else:
		l.append(char)
print(len(set(l)))


s = input()
s = s[1:]
s = s[:len(s) - 1]
s = s.split(', ')
s = ''.join(s)
l = []
for i in s:
	if i not in l:
		l.append(i)
print(len(l))


letters = input()
letters = letters.replace(letters[0], '')
letters = letters.replace(letters[len(letters) - 1], '')
w = [i for i in letters.split(',')]
w = ''.join(w)
w = [k for k in w.split()]
new = []
for n in w:
	if n.isalpha() == True and n not in new:
		new.append(n)
print(len(new))


totalNumbers = []
x = input()
x = x.replace('}', '').replace('{', '').replace(',', '').replace(' ', '')
for i in x:
	if i not in totalNumbers:
		totalNumbers.append(i)
print(len(totalNumbers))


import sys
s = sys.stdin.readline().strip()
s = s[1:-1]
if s:
	ans = set(s.split(', '))
	print(len(ans))
else:
	print(0)


s = input()
s = set(s)
k = len(s)
k = k - 2
if k == 1:
	print(1)
elif k == 0:
	print(0)
else:
	print(k - 2)


t = set(input().strip())
c = 0
for i in 'abcdefghijklmnopqrstuvwxyz':
	if i in t:
		c += 1
print(c)


s = input()
l = []
alp = 'abcdefghijklmnopqrstuvwxyz'
for i in s:
	if i in alp:
		l.append(i)
st = set(l)
print(len(st))


word = input()
a = ''
ans = 0
for i in range(1, len(word) - 1):
	if word[i] != ' ':
		a = a + word[i]
word_right = a.split(',')
for i in range(len(word_right)):
	for j in range(i + 1, len(word_right)):
		if word_right[i] == word_right[j]:
			word_right[j] = 0
for i in range(len(word_right)):
	if word_right[i] != 0 and word_right[i] != '':
		ans += 1
print(ans)


s = input()
b = []
for i in s:
	if i.isalpha():
		b.append(i)
print(len(set(b)))


S = input()
L = []
count = 0
for i in range(len(S)):
	if S[i].isalpha():
		if S[i] in L:
			pass
		else:
			L.append(S[i])
			count += 1
print(count)


s = set(input())
s1 = {'}', '{', ',', ' '}
s = s - s1
print(int(len(s)))


n = set(input().strip())
(n.remove('{'), n.remove('}'))
if ' ' in n:
	n.remove(' ')
if ',' in n:
	n.remove(',')
print(len(n))


x = input()
if x != '{}' and len(x) > 3:
	print(len(set(x)) - 4)
elif len(x) < 4 and x != '{}':
	print('1')
else:
	print('0')


arr = list(input())[1:]
arr = arr[0:len(arr) - 1]
if len(arr) > 0:
	arr = ''.join(arr).split(', ')
	dp = [0] * 30
	ctr = 0
	for ch in arr:
		i = ord(ch) - ord('a')
		if dp[i] == 0:
			ctr += 1
		dp[i] = 1
	print(str(ctr))
else:
	print('0')


t = input()
word = set(t.replace('{', '').replace('}', '').replace(' ', '').split(','))
if t == '{}':
	print(0)
else:
	print(len(set(word)))


def main():
	li = input()
	li = li.replace('{', '')
	li = li.replace('}', '')
	li = ' ' + li[:]
	li = list(li.split(','))
	li = set(li)
	cnt = 0
	for i in li:
		if i != ' ':
			cnt += 1
	print(cnt)
main()


line = input()
letters = {c for c in line if c.isalpha()}
print(len(letters))


s = input()
ls = s[1:len(s) - 1].split(', ')
l = []
for i in ls:
	if i not in l and i != '':
		l.append(i)
print(len(l))


a = input()
s = []
for i in a:
	if i not in ['{', '}', ',', ' '] and i not in s:
		s.append(i)
print(len(s))


auxiliar = []
linha = input()
for aux in range(1, len(linha) - 1):
	if linha[aux].isalpha() and (not linha[aux] in auxiliar):
		auxiliar.append(linha[aux])
print(len(auxiliar))


l = [i for i in input().split(',')]
z = []
length = len(l) - 1
if l == ['{}']:
	print(0)
else:
	f = l[0][1]
	last = l[-1][1]
	z.append(last)
	z.append(f)
	for i in l[1:length]:
		z.append(i[1])
	print(len(set(z)))


a = set()
for i in input():
	if i.isalpha():
		a.add(i)
print(len(a))


a = input()[1:-1].split(', ')
letters = 'abcdefghijklmnopqrstuvwxyz'
seen = []
count = 0
for char in a:
	if char not in seen and char != '':
		seen.append(char)
		count += 1
print(count)


a = set(input())
s = 0
for i in a:
	if i.isdigit() or i.isalpha():
		s += 1
print(s)


s = input('')
l = len(s)
list = []
for i in range(l):
	if s[i] >= 'a' and s[i] <= 'z':
		list.append(s[i])
list1 = []
for i in list:
	if i not in list1:
		list1.append(i)
print(len(list1))


x = input('')
n = 1
list = []
for c in range(1, len(x) - 1):
	list.append(x[n])
	if n == len(x) - 2:
		break
	n += 3
list = set(list)
print(len(list))


a = input()
list = []
letters = []
cnt = 0
bool = True
for i in range(1, len(a) - 1, 3):
	list.append(a[i])
for i in list:
	bool = True
	for j in letters:
		if i == j:
			bool = False
			break
	if bool:
		cnt += 1
		letters.append(i)
print(cnt)


a = input()
s = 0
for i in range(97, 123):
	if a.find(chr(i)) != -1:
		s += 1
print(s)


a = input()
b = {''}
for i in a:
	if i in '{}, ':
		continue
	else:
		b.add(i)
print(len(b) - 1)


import collections
t = input()
l = []
for i in t:
	if i == '{' or i == '}' or i == ',' or (i == ' '):
		continue
	l.append(i)
print(len(collections.Counter(l)))


letters = input()
num = 0
for i in range(26):
	if chr(97 + i) in letters:
		num += 1
print(num)


strings = input()[1:-1].split(',')
distinct = set()
for s in strings:
	s = s.strip()
	if len(s) > 0:
		distinct.add(s.strip())
print(len(distinct))


x = input()
x = x.replace('{', '')
x = x.replace('}', '')
x = x.replace(' ', '')
if x == '':
	print('0')
else:
	print(len(set(x.split(','))))


n = input()
s = n[1:-1]
st = set()
for ch in s.split():
	st.add(ch[0])
print(len(st))


print(len(list(set(filter(lambda x: x.isalpha(), input())))))


l = {}
l = input()
l2 = []
for i in l:
	num = ord(i)
	if num >= 97 and num <= 122:
		l2.append(num)
l2 = sorted(l2)
lenth = len(l2)
lenth1 = lenth
sum1 = 0
while lenth > 1:
	num1 = l2[lenth - 1] - l2[lenth - 2]
	if num1 != 0:
		sum1 += 1
	lenth -= 1
if lenth1 == 1 and sum1 == 0:
	sum1 = 1
elif sum1 != 0 and lenth1 > 1:
	sum1 += 1
elif lenth1 > 1 and sum1 == 0:
	sum1 = 1
else:
	sum1 = 0
print(sum1)


s = input()
s = s[1:len(s) - 1]
l = list(set(s))
if ',' in l:
	l.remove(',')
if ' ' in l:
	l.remove(' ')
print(len(l))


a = input()
uniques = []
for ele in a:
	if ele not in uniques:
		uniques.append(ele)
if len(a) == 2:
	print(0)
elif len(a) == 3:
	print(1)
else:
	print(len(uniques) - 4)


s = input()
s = set(s[1:-1])
if len(s) == 0:
	print('0')
elif len(s) == 1:
	print('1')
else:
	s.remove(',')
	s.remove(' ')
	print(len(s))


import collections
s = input()
a = []
for i in range(1, len(s), 3):
	a.append(s[i])
ctr = collections.Counter(a)
if s == '{}':
	print(0)
else:
	print(len(ctr))


a = list(input())
s = set(a)
if len(s) >= 4:
	print(len(s) - 4)
elif len(s) == 2:
	print(0)
elif len(s) == 3:
	print(1)


_a = input()
a = str(_a)
b = _a[1:len(a) - 1]
le = b.split(', ')
fq = 27 * [0]
s = 0
for i in range(int(len(a) / 3)):
	fq[ord(le[i]) - 96] += 1
for i in range(27):
	if fq[i] > 0:
		s += 1
	else:
		s = s
print(s)


n = input()
s = n[1:-1]
ss = set()
for ch in s:
	if ch == ',':
		pass
	if ch >= 'a' and ch <= 'z':
		ss.add(ch)
print(len(ss))


s = input().split(', ')
s[0] = s[0][1]
cnt = 0
if s[len(s) - 1] != '}':
	s[len(s) - 1] = s[len(s) - 1][0]
	for i in range(len(s)):
		if s[i] not in s[0:i]:
			cnt += 1
print(cnt)


s = input().strip('{}').split(', ')
u = [0] * 26
for i in s:
	try:
		u[ord(i) - ord('a')] += 1
	except:
		break
c = 0
for i in range(26):
	if u[i] is not 0:
		c += 1
print(c)


n = input()
l = []
m = []
for i in range(len(n)):
	if ord(n[i]) > 96 and ord(n[i]) < 123:
		l.append(n[i])
for j in range(len(l)):
	if l[j] not in m:
		m.append(l[j])
print(str(len(m)))


a = input()
num = 0
if a == '{}':
	print(0)
else:
	b = set(a)
	for x in b:
		if x.isalpha():
			num += 1
	print(num)


n = input()[1:-1].split(', ')
s = set(n)
if '' in n:
	print(0)
else:
	print(len(s))


letter = set(input().replace(' ', '').strip('{} ').split(','))
if letter == {''}:
	print(0)
else:
	print(len(letter))


s = input()
a = list(s)
d = list()
i = 0
while a[i] != '}':
	if a[i] != '{' and a[i] != ',' and (a[i] not in d) and (a[i] != ' '):
		d.append(a[i])
	i += 1
print(len(d))


letters = input()
letters = letters.replace('{', '').replace('}', '')
letter_set = set()
for letter in letters.split(','):
	if letter != '':
		letter_set.add(letter.strip())
print(len(letter_set))


from collections import Counter
set_alphabets = input()
set_alphabets = set_alphabets.strip('{,}')
convert = list(set_alphabets)
convert = [i.strip('{ },""') for i in convert]
convert = list(filter(None, convert))
count = Counter(convert)
count = set(count)
print(len(count))


import re
print(len(set(re.sub('{|}|\\s|,', '', input()))))


s = input().strip('{}')
l = []
for ch in s:
	if ch.isalpha():
		l.append(ch)
s = set(l)
print(len(s))


import string
s = str(input())
word = []
alp = string.ascii_lowercase
for i in s:
	for j in alp:
		if i == j:
			word.append(i)
n = len(set(word))
print(n)


dic = list(input())
c = []
t = [' ', '}', '{', ',']
for i in dic:
	if i not in c:
		c.append(i)
for j in t:
	if j in c:
		c.remove(j)
print(len(c))


n = input().strip()
arr = []
for i in n:
	if ord(i) >= 97 and ord(i) <= 122:
		if i not in arr:
			arr.append(i)
print(len(arr))


s = set(input())
q = {0}
for i in s:
	if 97 <= ord(i) <= 122:
		q.add(i)
q.remove(0)
print(len(q))


s = input()
if s == '{}':
	print(0)
else:
	lst = s.split(',')
	fst = str(lst[0])
	ln = len(lst)
	start = ' ' + fst[1]
	lst.pop(0)
	lst.insert(0, start)
	last = str(lst[ln - 1])
	lst.pop(ln - 1)
	ending = ' ' + last[1]
	lst.insert(ln - 1, ending)
	seta = set(lst)
	print(len(seta))


Anton_set = input()
unique = []
for i in Anton_set:
	if i.isalpha() and i not in unique:
		unique.append(i)
print(len(unique))


inputs = input()
ans = ''
temp = ''
for i in range(len(inputs)):
	if ord(inputs[i]) >= ord('a') and ord(inputs[i]) <= ord('z'):
		ans += inputs[i]
for i in range(len(ans)):
	if ans[i] not in temp:
		temp += ans[i]
print(len(temp))


letters = input().strip('{')
letters = letters.strip('}')
if len(letters) == 0:
	print(0)
else:
	letters = letters.split(', ')
	letters = set(letters)
	print(len(letters))


letters = input()[1:-1].split(', ')
if '' in letters:
	letters.remove('')
letter_set = set(letters)
print(len(letter_set))


s = input().strip()
if s == '{}':
	print(0)
else:
	s = s[1:-1]
	se = set((x.strip() for x in s.split(',')))
	print(len(se))


k = set(input()[1:-1].split(', '))
print([len(k), 0][k == {''}])


a = input()
if a == '{}':
	a = ''
else:
	a = a[1:-1]
	a = a.split(', ')
print(len(set(a)))


s = input()
u = {''}
for x in s:
	if x.isalpha():
		u.add(x)
print(len(u) - 1)


g = input('')
listA = []
for i in g:
	if i != '{' and i != '}' and (i != ',') and (i != ' '):
		if i not in listA:
			listA.append(i)
u = 0
for i in listA:
	u += 1
print(u)


x = input()
x = list(x)
n = 1
f = []
z = len(x)
while n < z:
	f.append(x[n])
	n += 3
f = set(f)
if x[1] == '}':
	print(0)
else:
	print(len(f))


print(len(set([x for x in input() if x not in ['{', '}', ',', ' ']])))


a = [0] * 26
b = list(input())
for i in b:
	if i >= 'a' and i <= 'z':
		a[ord(i) - 97] = 1
print(sum(a))


string1 = input()
string1 = string1[1:-1]
string1 = string1.replace(' ', '')
string1 = string1.replace(',', '')
x = []
y = []
for letters in string1:
	if letters not in x:
		x.append(letters)
		y.append(letters)
print(len(y))


s = input()
s = s[1:len(s) - 1]
if s != '':
	s = s.split(',')
	for i in range(1, len(s)):
		s[i] = s[i][1]
	print(len(set(s)))
else:
	print('0')


print(len(set(input()).difference({' ', ',', '{', '}'})))


s = input()[1:-1]
if s:
	chars = s.split(', ')
else:
	chars = list()
print(len(set(chars)))


import re
regex = re.compile('[^a-zA-Z]')
firstLine = str(input())
parsed = regex.sub('', firstLine)
if len(parsed) != 0:
	arr = list(parsed)
else:
	print(0)
	exit()
distinct = set(arr)
print(len(distinct))


s = set()
str = input()
length = len(str)
for i in range(0, length):
	if str[i].isalpha():
		s.add(str[i])
print(len(s))


def main():
	text = input()
	tab = [0] * 26
	for letter in text:
		if letter.isalpha():
			tab[ord(letter) - ord('a')] = 1
	print(tab.count(1))
main()


k = input()
s = []
for i in k:
	if i == '{' or i == '}' or i == ',' or (i == ' '):
		continue
	s.append(i)
print(len(set(s)))


a = input()
arr = []
for i in a[1:a.__len__() - 1].split(', '):
	arr.append(i)
if a == '{}':
	print(0)
else:
	print(set(arr).__len__())


a = list(input())
b = []
for x in a:
	if x.isalpha():
		b.append(x)
c = []
for l in b:
	if l not in c:
		c.append(l)
print(len(c))


s = input()
s1 = ''.join((c for c in s if c not in '{}, '))
print(len(set(s1)))


s = input()
d = dict()
for i in range(len(s)):
	if s[i] >= 'a' and s[i] <= 'z':
		d[s[i]] = d.get(s[i], 0) + 1
print(len(d))


def fun(antonletter):
	for i in antonletter:
		if i.isalpha():
			result.add(i)
	print(len(result))
antonletter = set(input())
result = set()
fun(antonletter)


a = list(input())
a = set(a)
if ',' in a:
	print(len(a) - 4)
else:
	print(len(a) - 2)


a = input()
b = a.replace(',', '')
c = b.replace('{', '')
d = c.replace('}', '')
e = d.replace(' ', '')
f = set(e)
print(len(f))


d = input()
s = set()
for c in d:
	if c.islower():
		s.add(c)
print(len(s))


dis = set()
s = input()
count = 0
for i in s:
	if i.isalpha() and i not in dis:
		count += 1
		dis.add(i)
print(count)


inp = input()
inp = inp.replace(',', '').replace(' ', '')
print(len(set(inp)) - 2)


s = list(set(list(input())))
s.remove('{')
s.remove('}')
if s.count(' ') != 0:
	s.remove(' ')
if s.count(',') != 0:
	s.remove(',')
print(len(s))


a = input()
a = a[1:len(a) - 1]
a = str(a)
if a == '':
	print('0')
else:
	a = a.split(', ')
	a = set(a)
	print(len(a))


s = input()
y = ['{', '}', ',', ' ']
x = {l for l in s if l not in y}
print(len(x))


s = str(input())
if len(s) > 2:
	cnt = 1
else:
	cnt = 0
s = s[1:-1]
s = s.split(', ')
s = sorted(s)
for i in range(1, len(s)):
	if s[i] != s[i - 1]:
		cnt += 1
print(cnt)


t = input()
x = set()
if t == '{}':
	print('0')
else:
	for i in range(1, len(t), 3):
		x.add(t[i])
	print(len(x))


n = str(input())
if len(n) <= 2:
	print(0)
else:
	n = n[1:-1].split(', ')
	s = set()
	for e in n:
		s.add(e)
	print(len(s))


lol = input()
if not lol == '{}':
	lol = list(lol[1:len(lol) - 1].split(', '))
	uniq = {}
	for i in lol:
		uniq[i] = 0
	print(len(uniq.keys()))
else:
	print(0)


l = input()
s = set()
for i in range(len(l)):
	if l[i] in 'abcdefghijklmnopqrstuvwxyz':
		s.add(l[i])
print(len(s))


n = input()
list_of_letters = list()
list_of_letters = list(n)
list_of_letters = set(list_of_letters)
count = 0
for i in list_of_letters:
	if i is '{' or i is '}' or i is ',' or (i is ' '):
		continue
	else:
		count = count + 1
print(count)


s = str(input())
b = []
for i in s:
	if i != '{' and i != '}' and (i != ',') and (b.count(i) == 0) and (i != ' '):
		b.append(i)
print(len(b))


x = input()
x = x[1:-1]
A = x.split(', ')
B = []
if len(x) == 0:
	print(0)
else:
	for i in range(len(A)):
		if A[i] in B:
			B = B
		else:
			B.append(A[i])
	print(len(B))


print(len(set(filter(lambda s: s.islower(), input()))))


a = input()
b = a[1:-1]
c = list(b.split(', '))
listk = []
if len(b) == 0:
	print(0)
else:
	for z in range(len(c)):
		if c[z] not in listk:
			listk.append(c[z])
	print(len(listk))


s = set(input() + ',')
print(len(s - set('{}, ')))


set = input()
check = [0] * 125
count = 0
for ch in set:
	if 'a' <= ch <= 'z' and (not check[ord(ch)]):
		count += 1
		check[ord(ch)] = 1
print(count)


n = input()
a = set(map(str, n[1:-1].split(', ')))
if n == '{}':
	print(0)
else:
	print(len(a))


x = {x for x in input().strip('{}').split(', ')}
if '' in x:
	print(0)
else:
	print(len(x))


a = set(input())
b = list(a)
c = len(b)
if c == 2:
	print(0)
elif c == 3:
	print(1)
else:
	print(c - 4)


line = str(input())
line = line.split('{')
line = line[1].split('}')
list2 = line[0].split(', ')
list1 = list(set(list2))
n = len(list1)
if list1[0] == '':
	n = 0
print(n)


s = input()
r = set()
for i in range(len(s)):
	if 'a' <= s[i] <= 'z':
		r.add(s[i])
print(len(r))


y = len(set(list(input()))) - 4
if y == -2:
	print(0)
elif y == -1:
	print(1)
else:
	print(y)


x = input()
n = len(x)
l = list(x[1:n - 1] + ' ' + ',')
l = set(l)
print(len(l) - 2)


import sys
import math
line = sys.stdin.readline()
l = len(line)
nl = ''
for i in range(1, l - 2):
	nl += line[i]
line = nl.split(', ')
l = len(line)
mas = []
for i in range(0, l):
	ln = len(mas)
	ch = True
	for j in range(0, ln):
		if mas[j] == line[i]:
			ch = False
			break
	if ch == True and line[i] != '':
		mas.append(line[i])
print(len(mas))


print(len(''.join(set(input().strip('{').strip('}').split(', ')))))


a = set(input())
abc = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'}
count = 0
for i in a:
	if i in abc:
		count += 1
print(count)


def AntonAndLetters():
	string = input().strip()[1:-1]
	if string != '':
		return len(set(string.split(', ')))
	else:
		return 0
a = AntonAndLetters()
print(a)


p = str(input())
t = p.replace('{', '').replace('}', '').replace(' ', '').replace(',', '')
print(len(set(t)))


n = input()
lst1 = []
lst2 = []
for i in range(len(n)):
	if n[i].isalpha():
		lst1.append(n[i])
for i in range(len(lst1)):
	if lst1[i] in lst2:
		continue
	else:
		lst2.append(lst1[i])
print(len(lst2))


s = list(input())
print(len(set([c for c in s if c.isalnum()])))


a = set([i.lstrip() for i in input()[1:-1].split(',')])
if '' in a:
	print(0)
else:
	print(len(a))


a = input()
b = list(a)
t = ['{', '}', ',', ' ']
for i in range(len(b)):
	if b[i] not in t:
		t.append(b[i])
t.remove('{')
t.remove('}')
t.remove(',')
t.remove(' ')
print(len(t))


s = input().split()
if s == ['{}']:
	print(0)
else:
	s[0] = s[0][1:]
	a = []
	for i in range(len(s)):
		s[i] = s[i][:-1]
		done = True
		for j in range(len(a)):
			if s[i] == a[j]:
				done = False
				break
		if done:
			a += [s[i]]
	print(len(a))


s = str(input())
num = []
for i in s:
	if i == '{':
		continue
	if i == '}':
		continue
	if i != ',' and i != ' ':
		if i not in num:
			num.append(i)
print(len(num))


a = input()
b = list(a)
lst2 = []
for j in b:
	if j not in lst2:
		if j != ' ' and j != '{' and (j != '}') and (j != ','):
			lst2.append(j)
r = len(lst2)
print(r)


s = input()
s1 = s[1:-1]
s2 = ''.join(str(s1))
s3 = list(set(s2))
if len(s3) > 2:
	print(len(s3) - 2)
else:
	print(len(s3))


s = input()
if s == '{}':
	print(0)
else:
	l = [x for x in s[1:-1].split(', ')]
	q = set()
	c = 0
	for i in l:
		if i not in q:
			c += 1
			q.add(i)
	print(c)


s = input()
li = []
for i in range(len(s)):
	if s[i] >= 'a' and s[i] <= 'z':
		li.append(s[i])
s = set(li)
print(len(s))


line = input()
line = line[1:-1].split(', ')
if line == ['']:
	print(0)
else:
	print(len(set(line)))


s = str(input())
K = []
for i in range(len(s)):
	if i % 3 == 1 and s[i] not in K:
		K = K + [s[i]]
k = len(K)
if len(s) == 2:
	k = k - 1
print(k)


a = input()
ans = set()
for i in a:
	if ord(i) >= 97 and ord(i) <= 97 + 25:
		ans.add(i)
print(len(ans))


class luck:

	def num(a):
		b = set()
		for i in a:
			if i.isalpha():
				b.add(i)
		return len(b)
a = input()
print(luck.num(a))


s = str(input())
x = [i.lstrip() for i in s[1:len(s) - 1].split(',')]
if len(s) == 2:
	print(0)
else:
	print(len(set(x)))


s = input()
s = list(s)
s1 = []
j = 0
for i in range(1, len(s) - 1, 3):
	s1.append(s[i])
	j += 1
s1 = list(s1)
s1 = set(s1)
print(len(s1))


letters = input()
if letters == {}:
	print(0)
else:
	line = set()
	for i in letters:
		while i.isalpha():
			line.add(i)
			break
	print(len(line))


s = input()
if len(s) == 2:
	print(0)
	exit()
else:
	char = s[1:-1].split(',')
	char = [x.strip() for x in char]
	print(len(set(char)))


a = input()
if len(a) > 4:
	b = a[1:len(a) - 1].split(', ')
	print(len(set(b)))
if len(a) == 3:
	print(1)
if len(a) == 2:
	print(0)


s = input()
s = s[1:-1]
s = s.split(', ')
l = len(s)
counter = 0
for i in range(l):
	if type(s[i]) != int:
		for j in range(l):
			if i != j:
				if s[i] == s[j]:
					s[j] = 0
			elif s[i] != '':
				counter += 1
print(counter)


n = input()
s = []
m = 'qwertyuiopasdfghjklzxcvbnm'
for i in n:
	if i in m:
		s.append(i)
s = set(s)
print(len(s))


l = input()
k = l.strip('{}')
rp = k.replace(',', '')
ls = []
for i in range(0, len(rp), 2):
	ls.append(rp[i])
s = set(ls)
print(len(s))


a = list(str(input()))
a.remove('{')
a.remove('}')
while ',' in a:
	a.remove(',')
	a.remove(' ')
print(len(set(a)))


n = input()
if n == '{}':
	print(0)
else:
	d = []
	for i in n:
		d.append(i)
	d = set(d)
	if len(d) > 4:
		print(len(d) - 4)
	else:
		print(len(d) - 2)


stroka = input()
stroka = stroka.replace('{', '')
stroka = stroka.replace('}', '')
listSymbols = stroka.split(', ')
setSymbols = set(listSymbols)
if '' in setSymbols:
	setSymbols.remove('')
print(len(setSymbols))


count = 0
s = input()
a = s[1:-1].split(', ')
a = sorted(a)
if a[0] != '':
	count = 1
for i in range(0, len(a) - 1):
	if a[i] != a[i + 1]:
		count += 1
print(count)


anton = input()
anton = set(anton)
if ' ' in anton:
	anton.remove(' ')
if ',' in anton:
	anton.remove(',')
anton.remove('}')
anton.remove('{')
print(len(anton))


line = set(input())
line.discard('}')
line.discard('{')
line.discard(' ')
line.discard(',')
if line == set():
	print(0)
else:
	print(len(line))


x = input()
y = []
for s in x:
	if s not in y:
		y.append(s)
	if s == '{':
		y.remove('{')
	elif s == '}':
		y.remove('}')
	elif s == ',':
		y.remove(',')
	elif s == ' ':
		y.remove(' ')
print(len(y))


x = input()
x = list(x)

def check(i):
	if ord(i) >= 97 and ord(i) <= 122:
		return True
	return False
k = list(filter(check, x))
k = set(k)
print(len(list(k)))


n = input()
x = {'{', '}', ',', ' '}
k = set(n) - x
print(len(k))


s = input()
if s == '{}':
	print(0)
else:
	l = list(map(str, s[1:len(s) - 1].split(', ')))
	s1 = set()
	if len(l) > 0:
		for i in l:
			s1.add(i)
	print(len(s1))


s = input()
n = len(s)
a = []
for item in range(1, n - 1, 3):
	a.append(s[item])
b = str()
for item in a:
	if item not in b:
		b = b + item
print(len(b))


a = input()
d = sorted(a)
l = []
k = 0
for i in d:
	if i not in l:
		if i >= 'a' and i <= 'z':
			l.append(i)
			k = k + 1
print(k)


a = input()
c = 0
s = set(a)
for i in s:
	if i.isalpha():
		c += 1
print(c)


s1 = input()
s2 = s1[1:-1]
s3 = s2.split(', ')
if len(s1) == 2:
	print(0)
else:
	print(len(set(s3)))


a = list(input()[1:-1])
while ',' in a:
	a.remove(',')
while ' ' in a:
	a.remove(' ')
print(len(set(a)))


st = input()
ma = {}
for i in range(0, len(st)):
	if st[i] >= 'a' and st[i] <= 'z':
		ma[st[i]] = 1
print(len(ma))


words = input()
letters = []
for i in words:
	if not i in letters and (not i in '}{, \n'):
		letters.append(i)
print(len(letters))


str = input()
if len(str) <= 2:
	print(0)
else:
	x = str[1:len(str) - 1]
	array2 = []
	for i in x.split(', '):
		if i not in array2:
			array2.append(i)
	print(len(array2))


x = input()
x = x[1:]
x = x[:-1]
x = x.replace(' ', '')
x = x.replace(',', '')
x = {i for i in x}
print(len(x))


x = input()
y = len(x)
z = set(x)
if y > 4:
	print(len(z) - 4)
if y == 3:
	print(1)
if y == 2:
	print(0)


s = input()
str = ''
for i in s:
	if i >= 'a' and i <= 'z':
		if i not in str:
			str = str + i
print(len(str))


a = input()
print(len(list(set(list(map(str, a.translate({ord(i): None for i in '{} '}).split(sep=',')))))) if a != '{}' else 0)


l = []
n = list(input())
for term in n:
	if term not in ('{', ' ', '}', ','):
		l.append(term)
print(len(set(l)))


s = input()
x = len(set(list(s)))
if x == 3:
	print('1')
elif x - 4 < 0:
	print('0')
else:
	print(x - 4)


inp = input()
li = inp.split(', ')
load = []
for x in li:
	if len(x) >= 2:
		if x == '{}':
			break
		elif x[0] == '{':
			x = x[1]
		elif x[1] == '}':
			x = x[0]
		else:
			break
	if x not in load:
		load += [x]
print(len(load))


s = [str(_).strip() for _ in input().split(',')]
ls = len(s)
if ls == 1:
	if s[0][1] == '}':
		print(0)
		exit()
	else:
		print(1)
		exit()
s[0] = s[0][1]
s[ls - 1] = s[ls - 1][0]
print(len(set(s)))


def antonLetters(s):
	n = len(s)
	lst = []
	for i in range(0, n):
		if s[i] not in ('{', '}', ',', ' '):
			lst.append(s[i])
	return len(set(lst))
s = input()
print(antonLetters(s))


line = input()
line = line[1:-1]
if len(line) == 0:
	print(0)
elif len(line) == 1:
	print(1)
elif len(line) > 1:
	a = line.split(', ')
	n = len(a)
	new = [a[0]]
	for i in range(n - 1):
		if a[i + 1] not in new:
			new.append(a[i + 1])
	print(len(new))


def main():
	a = input()
	b = a[1:len(a) - 1]
	if len(b) == 0:
		print(0)
		return
	print(len(set(b.split(', '))))
main()


import re
string = input()
result = re.findall('[a-z]', string, True)
print(len(set(result)))


s = input()
res = []
res[:0] = s
a = ['{', '}', ',']
b = []
count = 0
for i in res:
	if i in a:
		continue
	elif i == ' ':
		continue
	elif i in b:
		continue
	else:
		b.append(i)
		count = count + 1
print(count)


sett = [x for x in input()]
l = []
check = 0
l.append(sett[1])
if len(sett) == 2:
	print(0)
else:
	i = 4
	while i <= len(sett):
		for j in range(len(l)):
			if sett[i] == l[j]:
				check += 1
		if check == 0:
			l.append(sett[i])
		i += 3
		check = 0
	print(len(l))


import sys
s = sys.stdin.readline().rstrip()
s = s[1:-1]
s = s.split(', ')
s = set(s)
if '' in s:
	print(0)
else:
	print(len(s))


a = str(input())
b = a.replace(',', '')
c = b.lstrip('{')
d = c.rstrip('}')
e = [str(i) for i in d.split()]

def deleteDuplicatedElementFromList(list):
	list.sort()
	length = len(list)
	lastItem = list[length - 1]
	for i in range(length - 2, -1, -1):
		currentItem = list[i]
		if currentItem == lastItem:
			list.remove(currentItem)
		else:
			lastItem = currentItem
	return list
if e == []:
	print(0)
else:
	deleteDuplicatedElementFromList(e)
	print(len(e))


line = set(input().strip('{}').split(', '))
if len(line) == 1 and '' in line:
	print('0')
else:
	print(str(len(line)))


n = input()
lst = []
for i in range(1, len(n) - 1, 3):
	lst.append(n[i])
lst = set(lst)
print(len(lst))


letters = input()
letters = letters[1:len(letters) - 1]
letters = letters.split(',')
letters = [i.strip() for i in letters]
letters = filter(None, letters)
print(len(list(set(letters))))


s = set(input())
for i in [' ', ',', '{', '}']:
	if i in s:
		s.remove(i)
print(len(s))


arr = input()
brr = arr[1:len(arr) - 1]
crr = brr.split(', ')
if len(arr) == 2:
	print(0)
else:
	count = []
	for i in range(26):
		count.append(0)
	for i in crr:
		count[ord(i) - 97] = count[ord(i) - 97] + 1
		ans = 0
	for i in count:
		if i != 0:
			ans = ans + 1
	print(ans)


s = set(input().replace(',', '').replace(' ', ''))
print(len(s) - 2)


str1 = input()
c1 = 0
d = dict.fromkeys(str1, 0)
for c in str1:
	d[c] += 1
l = list(d.keys())
for i in range(len(l)):
	if ord(l[i]) >= 97 and ord(l[i]) <= 122:
		c1 = c1 + 1
print(c1)


s = input()
rs = s[1:-1]
if len(rs) > 0:
	rs = rs.split(', ')
	dic = {}
	inc = 0
	for item in rs:
		if not item in dic:
			dic[item] = 1
			inc += 1
	print(inc)
else:
	print(0)


l = input()
if l == '{}':
	print(0)
elif len(l) == 3:
	print(1)
else:
	le = l[1:-1]
	let = le.split(', ')
	lett = []
	lette = 0
	for letter in let:
		if letter not in lett:
			lett.append(letter)
			lette += 1
	print(lette)


import sys
withFile = 0
if withFile == 1:
	fin = open('input.txt', 'r')
	fout = open('output.txt', 'w')

def getl():
	if withFile == 0:
		return input()
	else:
		return fin.readline()

def printl(s):
	if withFile == 0:
		print(s)
	else:
		fout.write(str(s))

def get_arr():
	x = getl().split(' ')
	if x[-1] == '':
		x = x[:-1]
	return list(map(int, x))
a = getl()
if a == '{}':
	print(0)
	sys.exit(0)
a = a[1:-1]
a = a.split(', ')
x = set(a)
printl(str(len(x)))
if withFile == 1:
	fin.close()
	fout.close()


l = len(set(list(input())))
if l > 3:
	print(l - 4)
else:
	print(l - 2)


def unique(li):
	temp = []
	[temp.append(x) for x in li if x not in temp]
	return len(temp)
li = [x for x in input() if x not in '{,} ']
print(unique(li))


arr = list(map(str, input().split(', ')))
a1 = arr[0].split('{')
aN = arr[len(arr) - 1].split('}')
if len(arr) > 1:
	a_ans = []
	if a1[1].isalpha() == True:
		a_ans.append(a1[1])
	else:
		pass
	for i in range(1, len(arr) - 1):
		a_ans.append(arr[i])
	if aN[0].isalpha() == True:
		a_ans.append(aN[0])
	else:
		pass
	a_ans = set(a_ans)
	print(len(a_ans))
elif a1[1] == '}':
	print(0)
else:
	print(1)


s = input()
s = s[1:-1:3]
print(len(set(s)))


i = input()
f = ''
i = i[1:-1].split(', ')
for c in i:
	if f.find(c) < 0:
		f += c
print(len(f))


s = input()
s = s.strip('{}')
s = s.split(', ')
s = set(s)
s = list(filter(None, s))
print(len(s))


s = input()
s = s.replace('{', '')
s = s.replace('}', '')
s = s.replace(',', '')
sum = 0
for i in range(len(s)):
	if s[i] != ' ':
		sum += 1
		s = s.replace(s[i], ' ')
print(sum)


a = input()
ar = []
for i in a:
	if i != '{' and i != '}' and (i not in ar) and (i != ',') and (i != ' '):
		ar.append(i)
print(len(ar))


s = set(input())
if ' ' and ',' in s:
	print(max(0, len(s) - 4))
else:
	print(max(0, len(s) - 2))


s = input()
x = list()
l = len(s)
for i in range(l):
	if s[i].isalpha():
		x.append(s[i])
r = set(x)
print(len(r))


a = input().replace('{', '').replace('}', '').replace(' ', '').replace(',', '')
print(len(set(list(a))))


s = input()
s = s[1:-1]
l = []
for i in range(0, len(s), 3):
	if s[i] not in l:
		l.append(s[i])
print(len(l))


s = input()
a = [0] * 26
for i in s:
	if 96 < ord(i) < 123:
		a[ord(i) - 97] = 1
y = 0
for i in range(26):
	if a[i] is 1:
		y += 1
print(y)


q = 26 * [0]
c = input()
for k in c:
	for i in range(97, 123):
		if k == chr(i):
			q[i - 97] += 1
n = 0
for z in q:
	if z > 0:
		n = n + 1
print(n)


a = input()
li2 = []
li = [char for char in a]
li.remove(li[0])
li.remove(li[len(li) - 1])
if len(li) == 0:
	print('0')
else:
	for i in li:
		if i not in li2:
			li2.append(i)
	print(abs(len(li2) - 2))


n = [i for i in input() if i.isalpha()]
c = 0
e = set()
for i in range(len(n)):
	if n[i] in e:
		pass
	else:
		e.add(n[i])
print(len(e))


t = set()
x = input()
for i in range(0, len(x)):
	if x[i].isalpha():
		t.add(x[i])
print(len(t.union(t)))


import math

def letters(s):
	if len(s) <= 2:
		return 0
	s = s[1:-1]
	letters_set = set(s.split(', '))
	return len(letters_set)

def main():
	print(letters(input()))
main()


word = input()
word = word[1:len(word) - 1]
list_chars = []
for letter in word:
	if letter != ',' and letter != ' ':
		list_chars.append(letter)
print(len(set(list_chars)))


string = input()
d = {}
for letter in string:
	if letter.isalpha():
		d[letter] = d.get(letter, 0) + 1
print(len(d.keys()))


level_x = set(input())
sm = 0
for i in level_x:
	if 'a' <= i <= 'z':
		sm += 1
print(sm)


m = input()
m1 = m.replace('{', ',')
m2 = m1.replace('}', ',')
a = 0
s = 'qwertyuiopasdfghjklzxcvbnm'
for char in s:
	k = m.find(char)
	if k != -1:
		a += 1
print(a)


a = input().strip('{}')
a = a.split(', ')
if a == ['']:
	print(0)
else:
	print(len(set(a)))


a = input()
b = a[1:-1].strip()
if b == '':
	print(0)
else:
	print(len(set(b.split(', '))))


d = str(input())
al = 'abcdefghijklmnopqrstuvwxyz'
s = 0
for elt in al:
	for el in d:
		if elt == el:
			s += 1
			break
print(s)


import re
c = input()
letras = []
num = 0
for i in range(0, len(c)):
	if c[i].isalpha() and c[i] not in letras:
		letras.append(c[i])
		num += 1
print(num)


from collections import OrderedDict
s = str(input())
s = s.replace('{', '')
s = s.replace('}', '')
s = s.replace(',', '')
s = s.replace(' ', '')
r = ''.join(OrderedDict.fromkeys(s))
print(len(r))


s = input()
if len(s) == 2:
	print('0')
else:
	line = s[1:-1].split(', ')
	Set = set(line)
	print(len(Set))


def conv(li):
	st = ''
	for i in li:
		st = st + i
	return st
s = input()
if len(s) == 2:
	print(0)
else:
	s = s[1:len(s) - 1]
	print(len(set(conv(s.split(',')).split(' '))))


word = input()
word = word[1:-1]
if word == '':
	print(0)
else:
	disp = word.split(', ')
	print(len(set(disp)))


array = []
count = 0
string1 = input()
for i in range(1, len(string1) - 1):
	if string1[i] != ',' and string1[i] != ' ':
		array.append(string1[i])
		count += 1
array.sort()
i = 0
while i < len(array):
	t = array.count(array[i])
	count = count - t + 1
	i += t
print(count)


list = input()
if len(list) == 2:
	print(0)
else:
	list = list[1:len(list) - 1]
	list = list.split(', ')
	set = set(list)
	print(len(set))


s = input()
count = 0
p = []
for i in s:
	if i not in ', {}' and i not in p:
		count += 1
		p.append(i)
print(count)


text = input()
if len(text) == 2:
	print(0)
else:
	text = text[1:len(text):3]
	alphabets = []
	for i in range(0, 26):
		alphabets.append(0)
	for i in range(0, len(text)):
		alphabets[ord(text[i]) - ord('a')] += 1
	count = 0
	for i in range(0, 26):
		if alphabets[i] != 0:
			count += 1
	print(count)


l = list(input())
d = []
for i in l:
	if i.isalpha():
		d.append(i)
print(len(set(d)))


a = input()
list = []
for i in a:
	list.append(i)
list.remove(list[0])
list.remove(list[-1])
set2 = set(list)
if ',' in set2:
	set2.remove(',')
if ' ' in set2:
	set2.remove(' ')
print(len(set2))


lists = list(map(ord, list(input())))
char = []
for i in range(len(lists)):
	if 97 <= lists[i] < 123:
		char.append(lists[i])
sets = set(char)
print(len(sets))


s = input()
n = len(s)
list1 = []
for i in range(n):
	if s[i] not in list1 and s[i] != ' ' and (s[i] != ','):
		list1.append(s[i])
print(len(list1) - 2)


letters = input('')
letters = letters[1:-1].split(', ')
if letters[0] == '':
	letters.pop(0)
letters = set(letters)
original = len(letters)
print(original)


string = str(input(''))
c = 0
if string != '{}':
	string = string.strip('{')
	string = string.strip('}')
	items = string.split(', ')
	list = []
	for item in items:
		if item not in list:
			list.insert(len(list), item)
			c = c + 1
print(c)


l = list(input())
l = l[1:-1]
l = set(l)
if ' ' in l and ',' in l:
	print(len(l) - 2)
else:
	print(len(l))


def t(n):
	a = set()
	for i in n:
		if i not in a and i.isalpha():
			a.add(i)
	return len(a)
print(t(list(input())))


def main():
	s = input()
	s = s.replace('{', '')
	s = s.replace('}', '')
	l = s.split(', ')
	if '' in l:
		l.remove('')
	print(len(set(l)))
main()


k = input('')
g = set(k)
if ' ' and ',' in g:
	print(len(g) - 4)
elif len(g) == 3:
	print('1')
else:
	print('0')


a = input()
i = 1
b = list()
while i < len(a):
	b.append(a[i])
	i += 3
c = set(b)
if len(a) < 3:
	print(0)
else:
	print(len(c))


n = set(input())
for i in ' ,{}':
	n.discard(i)
print(len(set(n)))


k = input()
k = k[1:-1].split(', ')
dict = {}
for i in k:
	if i == '':
		continue
	dict[i] = dict.get(i, 0) + 1
print(len(dict))


s = input()
l = []
c = 0
for i in s:
	if i.isalpha():
		if i not in l:
			l.append(i)
			c += 1
print(c)


a = input()
alist = list(a)
lenh = len(alist)
seti = set(alist)
leni = len(seti) - 2
if leni > 2:
	print(leni - 2)
else:
	print(leni)


def Main():
	str1 = input()
	ans = 0
	cnt = 26 * [0]
	for cr in str1:
		if cr.isalpha() == True:
			if cnt[ord(cr) - 97] == 0:
				cnt[ord(cr) - 97] = 1
				ans += 1
	print(ans)
Main()


s = input()
if len(s) == 2:
	print(0)
else:
	myset = set(s[1:-1].split(', '))
	print(len(myset))


line = input()
line = line[1:-1]
letters = line.split(', ')
n_lett = []
for i in range(26):
	n_lett.append(0)
for letter in letters:
	if len(letter) > 0:
		n_lett[ord(letter[0]) - ord('a')] += 1
n_lettere = 0
for i in range(26):
	if n_lett[i] != 0:
		n_lettere += 1
print(str(n_lettere))


s = input().replace('{', '').replace('}', '')
new_s = s.replace(',', '', s.count(',')).split()
print(len(set(new_s)))


s = input()
s = s.replace('{', '')
s = s.replace('}', '')
s = s.replace(',', '')
l = list(s.split())
t = set()
for i in l:
	t.add(i)
print(len(t))


x = input()
n = 0
y = []
while 3 * n + 1 < len(x):
	y.append(x[3 * n + 1])
	n = n + 1
x = 'abcdefghijklmnopqrstuvwxyz'
n = 0
for i in range(26):
	if x[i] in y:
		n = n + 1
print(n)


m = list(map(str, input().split(',')))
n = ''
for i in m:
	i = i.replace('{', '')
	i = i.replace('}', '')
	n += i
data = list(set(n))
count = 0
for i in data:
	if i != ' ':
		count += 1
print(count)


n = input()
if n == '{}':
	print(0)
else:
	n = n.replace('{', '')
	n = n.replace('}', '')
	n = n.split(', ')
	print(len(set(n)))


str1 = input()
k = 0
dict1 = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'}
for i in str1:
	if i in dict1:
		k = k + 1
		dict1.remove(i)
print(k)


def unique(s):
	return len(set(s))
x = input()
x = x.replace('{', '')
x = x.replace('}', '')
x = x.replace(' ', '')
x = x.replace(',', '')
print(unique(x))


n = len(set(input()))
print(n - 4 if n > 3 else n - 2)


l = list(input())
a = set(l)
if len(a) != 3:
	x = len(a) - 4
	if x < 0:
		print(0)
	else:
		print(x)
else:
	print(1)


import re
s = input()
print(len(set(re.split('[{,}]\\s*', s))) - 1)


string = input()
written = []
for char in string:
	if char.isalpha() and char not in written:
		written.append(char)
print(len(written))


s = input()
p = s[1:-1]
m = p.replace(', ', '')
l = list(m)
if len(l) - len(list(set(l))) == 0:
	print(len(m))
else:
	print(len(list(set(l))))


inp = list(input().strip('{}').split(', '))
new = set(inp)
new = list(new)
if len(new) == 1 and new[0] == '':
	print(0)
else:
	print(len(new))


line = input()
lineToList = list(line)
if len(lineToList) - 2 == 0:
	print(0)
elif len(lineToList) - 2 == 1:
	print(1)
else:
	unique_chars = set(lineToList)
	print(len(unique_chars) - 4)


s = list(set(input().lstrip('{').rstrip('}').split(', ')))
for i in s:
	if i == '':
		s.remove(i)
print(len(s))


def func(s):
	if s == '{}':
		return 0
	else:
		li = s[1:len(s) - 1].split(', ')
		return len(set(li))
s = input()
print(func(s))


strr = input()
if len(strr) == 2:
	print(0)
else:
	cnt = 0
	i = 1
	temp = []
	while i < len(strr):
		if strr[i] not in ['{', '}', ' ', ','] and strr[i] not in temp:
			temp.append(strr[i])
			cnt = cnt + 1
		i = i + 1
	print(cnt)


c = {}
a = input()
c = {ord(b) for b in a if ord(b) >= ord('a') and ord(b) <= ord('z')}
print(len(c))


s = input()[1:-1].split(',')
if len(s) == 1 and s[0] == '':
	print(0)
	exit(0)
for i in range(len(s)):
	s[i] = s[i].strip()
print(len(set(s)))


a = {x for x in input()[1:-1].split(', ')}
if '' not in a:
	print(len(a))
else:
	print(0)


line = [str(x) for x in list(input())]
line2 = []
for x in line:
	if not (x == '{' or x == ',' or x == ' ' or (x == '}')):
		line2.append(x)
blank = []
for x in line2:
	if x not in blank:
		blank.append(x)
print(len(blank))


n = input()
x = []
for i in n:
	if i >= 'a' and i <= 'z':
		if i not in x:
			x.append(i)
print(len(x))


n = input()
if len(n) == 2:
	print(0)
else:
	k = ''
	for i in range(len(n)):
		if n[i] != ' ':
			k = k + n[i]
	k = k[1:len(k) - 1].split(',')
	print(len(set(k)))


txt = set(input() + ',' + ' ')
print(len(txt) - 4)


a = input()
a = a[1:-1]
c = len(a)
a = a.split(', ')
a = set(a)
if c != 0:
	print(len(a))
else:
	print(0)


from collections import Counter
counts = Counter()
lset = input().strip()
for letter in lset[1:-1]:
	if letter.isalpha():
		counts[letter] += 1
print(len(counts))


(l, i) = (input(), [])
for j in l:
	if ord(j) >= 97 and ord(j) <= 122:
		i.append(j)
	elif ord(j) >= 65 and ord(j) <= 90:
		i.append(j)
print(len(set(i)))


a = input()
b = ''
for element in a:
	if element >= 'a' and element <= 'z':
		b += element
print(len(set(b)))


t = input()
l = []
for i in t:
	if i >= 'a' and i <= 'z':
		l.append(i)
print(len(set(l)))


s = input()
s = s.translate({ord(i): None for i in '{}, '})
b = ''
for ch in s:
	if ch not in b:
		b = b + ch
a = len(b)
print(a)


a = list(input())
b = []
for i in range(0, len(a) // 3):
	b += [a[3 * i + 1]]
c = 26 * [0]
for i in range(0, len(b)):
	c[ord(b[i]) - ord('a')] += 1
s = 0
for i in range(0, 26):
	if c[i] != 0:
		s += 1
print(s)


a = input()
b = a.strip('{')
c = b.strip('}')
l = c.split(', ')
if l == ['']:
	print('0')
else:
	l = set(l)
	print(len(l))


s = input().strip('}')
s = s[1:]
d = {}
l = s.split(', ')
if s == '':
	print('0')
else:
	for i in l:
		d[i] = l.count(i)
	print(len(d))


from collections import Counter
s = input()
s = s[1:-1]
s = s.strip()
if len(s) == 0:
	print('0')
else:
	q = list(s.split(','))
	s = []
	res = 0
	for i in range(len(q)):
		q[i] = q[i].strip()
		if q[i] not in s:
			s.append(q[i])
			res += 1
	print(res)


c = input().lstrip('{').rstrip('}').split(', ')
print(len(set(c)) if c != [''] else 0)


s = input()
n = len(s)
s = s[1:n - 1]
arr = []
arr = s.split(', ')
dic = {}
if len(s) == 0:
	print(0)
else:
	for x in arr:
		if not x in dic:
			dic[x] = 1
		else:
			dic[x] += 1
	print(len(dic))


import string
letters = input().strip('{').strip('}').split(', ')
count = 0
for i in string.ascii_lowercase:
	if i in letters:
		count += 1
print(count)


s = input()
d = ''
for i in s:
	if i.isalpha():
		d = d + i
print(len(set(d)))


a = input()
a = a[1:-1]
l = a.split(', ')
if '' in l:
	l.remove('')
i = 0
while i < len(l):
	if l[:i].count(l[i]) != 0:
		del l[i]
	else:
		i += 1
print(len(l))


st = input()
ls = []
for char in st:
	if char >= 'a' and char <= 'z':
		if char not in ls:
			ls.append(char)
print(len(ls))


import sys
f = sys.stdin
St = f.readline().strip()
letters = {}
for s in St:
	if s not in '{, }':
		if s not in letters:
			letters[s] = 1
print(len(letters))


line = input()[1:-1].split(', ')
if '' in line:
	line.remove('')
print(len(set(line)))


s = input()
list = []
for i in range(len(s)):
	if (s[i] not in list) & s[i].isalpha():
		list.append(s[i])
print(len(list))


s = input()
if s == '{}':
	print(0)
else:
	x = s[1:-1].split(', ')
	print(len(list(set(x))))


s = input()
s = s[1:len(s) - 1]
a = s.split(', ')
finalarr = []
for x in a:
	if x not in finalarr and x != '':
		finalarr.append(x)
print(len(finalarr))


a = input()
c = []
for item in a:
	if not (item == '{' or item == '}' or item == ' ' or (item == ',')):
		c.append(item)
from collections import Counter
c = Counter(c)
print(len(c.keys()))


while True:
	try:
		ch = input()
		if len(ch) < 1001:
			break
	except:
		continue
L = []
for i in ch:
	if i not in [' ', '{', '}', ',']:
		L.append(i)
s = set(L)
print(len(s))


s = input()
if s == '{}':
	print(0)
else:
	s = s.replace('{', '')
	s = s.replace('}', '')
	x = list(s.split(', '))
	print(len(set(x)))


import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
readint = lambda : int(sys.stdin.readline().rstrip('\r\n'))
readints = lambda : map(int, sys.stdin.readline().rstrip('\r\n').split())
readstr = lambda : sys.stdin.readline().rstrip('\r\n')
readstrs = lambda : map(str, sys.stdin.readline().rstrip('\r\n').split())
readarri = lambda : [int(_) for _ in sys.stdin.readline().rstrip('\r\n').split()]
readarrs = lambda : [str(_) for _ in sys.stdin.readline().rstrip('\r\n').split()]

def solve():
	s = readstr()[1:-1]
	s = set(s.split(', '))
	while '' in s:
		s.remove('')
	print(len(s))

def main():
	t = 1
	for _ in range(t):
		solve()
main()


s = input()
alpha = [chr(i + 97) for i in range(26)]
distinct = {}
for i in s:
	if i in alpha:
		distinct[i] = 1
print(len(distinct))


ar = input()
s = ar[1:len(ar) - 1]
if len(s) == 0:
	print(0)
else:
	tmp = list(s.split(', '))
	print(len(set(tmp)))


line = str(input())
if len(line) >= 2 and len(line) <= 1000 and (line[0] == '{') and (line[-1] == '}'):
	alphabet = 'abcdefghijklmnopqrstuvwxyz'
	count = 0
	for i in alphabet:
		if i in line:
			count += 1
	print(count)


s = input()
set_ = set()
for i in range(1, len(s) - 1):
	if s[i] != ',' and s[i] != ' ':
		set_.add(s[i])
print(len(set_))


a = input()
(b, c) = a.split('{')
(d, e) = c.split('}')
d = d.replace(', ', '')
s = []
t = 0
for i in d:
	if i not in s:
		t = t + 1
		s.append(i)
print(t)


s = input()
if s == '{}':
	print('0')
else:
	s1 = s[1:len(s) - 1]
	l = s1.split(', ')
	print(len(set(l)))


s = input()
s = s.replace('{', '')
s = s.replace('}', '')
s = s.replace(',', '')
s = s.replace(' ', '')
res = set()
for i in s:
	res.add(i)
print(len(res))


s = input()
p = set('1')
t = ''
l = 0
for i in range(1, len(s) - 1):
	if s[i] == ',':
		if not t in p:
			p.add(t)
			l += 1
		t = ''
	elif s[i] != ' ':
		t += s[i]
else:
	if not t in p and t != '':
		l += 1
print(l)


a = input()
D = {}
for i in a[1:-1].split(', '):
	if i != '':
		D[i] = 0
print(len(D))


s = input()
p = set()
for x in s:
	p.add(x)
p.remove('{')
p.remove('}')
if ',' in s:
	p.remove(',')
if ' ' in s:
	p.remove(' ')
print(len(p))


line = input()
l1 = []
for i in line:
	if ord('a') <= ord(i) <= ord('z'):
		l1.append(i)
s1 = set(l1)
l2 = list(s1)
print(len(l2))


s = input()
a = []
for i in range(1, len(s) - 1, 3):
	a.append(s[i])
t = set(a)
print(len(t))


s = input()
lst = []
for i in s:
	if i == '{' or i == '}' or i == ',' or (i == ' '):
		pass
	else:
		lst.append(i)
print(len(list(dict.fromkeys(lst))))


s = input()
k = set(s)
l = len(k)
if l == 2:
	print(0)
elif l == 3:
	print(1)
else:
	print(l - 4)


print(len(set([letter for letter in input() if letter.islower()])))


s = input()
s = str(s[1:len(s) - 1])
l = s.split(', ')
alphabet = 'abcdefghijklmnopqrstuvwxyz'
a = []
for i in l:
	if i in alphabet and i not in a:
		a.append(i)
if a == ['']:
	print('0')
else:
	print(len(a))


s = input()
z = [i for i in s if i.isalpha()]
print(len(set(z)))


entry = input().replace('{', '').replace('}', '').replace(', ', '')
unique = ''
cnt = 0
for e in entry:
	if e not in unique:
		cnt += 1
		unique += e
print(cnt)


l = input()
if len(l) >= 6:
	print(len(set(l)) - 4)
elif len(l) == 3:
	print(1)
else:
	print(0)


letters = input()
letters = letters[1:len(letters) - 1]
letters = letters.split(', ')
alphabet = 'abcdefghijklmnopqrstuvwxyz'
letters_present = [0] * 26
for letter in letters:
	for (alph_idx, alph_letter) in enumerate(alphabet):
		if alph_letter == letter:
			letters_present[alph_idx] = 1
			break
n_different = 0
for letter_present in letters_present:
	if letter_present == 1:
		n_different += 1
print(n_different)


n = input()
arr = []
m = len(n) - 1
i = 1
while i < m:
	x = n[i]
	arr.append(x)
	i += 3
arr = set(arr)
print(len(arr))


arr = list(map(str, input().rstrip('')))
ar = []
for i in arr:
	if 97 <= ord(i) <= 122:
		ar.append(i)
	else:
		continue
print(len(set(ar)))


hello = input()
letters = []
for i in hello:
	if i not in letters and i not in [',', '{', '}', ' ']:
		letters.append(i)
print(len(letters))


str = input()
nstr = []
for i in range(len(str)):
	if str[i] == '{' or str[i] == ',' or str[i] == '}' or (str[i] == ' '):
		continue
	else:
		nstr.append(str[i])
print(len(set(nstr)))


s = input()
k = s.split('{')
x = k[1].split('}')
x.pop()
y = x[0].split(', ')
l = []
for i in range(len(y)):
	if y[i] not in l and y[i] != '':
		l.append(y[i])
print(len(l))


s = input()
L = ['{', '}', ',', ' ']
for i in s:
	if i not in L:
		L = L + [i]
print(len(L) - 4)


s = input()
p = set()
for x in s:
	if x != ' ' and x != '{' and (x != '}') and (x != ','):
		p.add(x)
print(len(p))


str = input()[1:-1].split(', ')
print(len(''.join(set(str))))


n = input().strip('{|}')
if n == '':
	print('0')
	quit()
n = n.split(', ')
length = len(n)
output = []
for i in range(length):
	if i == 0:
		output.append(n[0])
	elif n[i] not in n[0:i]:
		output.append(n[i])
print(len(output))


d = set(input().strip('}').strip('{').split(', '))
if '' in d:
	print(0)
else:
	print(len(d))


b = input()
a = set(b[1::3])
print('0' if a == {'}'} else len(a))


s = input()
s = s.replace('{', '')
s = s.replace('}', '')
s = s.replace(',', '')
s = s.replace(' ', '')
if s == '{}':
	print('0')
else:
	unique = []
	for char in s[:]:
		if char not in unique:
			unique.append(char)
print(len(unique))


n = list(input())
m = set()
for i in n:
	if i != ',' and i != '{' and (i != '}') and (i != ' '):
		m.add(i)
print(len(m))


s = [n for n in input()]
z = []
for n in s:
	if ord('z') >= ord(n) >= ord('a'):
		z.append(n)
for n in range(len(z)):
	if z.count(z[n]) != 1:
		z[n] = 0
print(len(z) - z.count(0))


a = input()
a = a[1:]
a = a[:-1]
a = list(map(str, a.split(', ')))
dic = {}
for i in a:
	if i != '':
		dic[i] = 1
s = 0
for i in dic.values():
	s += i
print(s)


s = input().strip()
s = s[1:len(s) - 1]
if len(s) == 0:
	n = 0
else:
	n = len(set(list(s.strip().split(', '))))
print(n)


a = len(set(input())) - 4
if a == -2:
	print(0)
elif a == -1:
	print(1)
else:
	print(a)


a = list(map(str, input().split(', ')))
b = []
count = 0
for i in range(len(a)):
	if len(a) == 1:
		if a == ['{}']:
			break
		else:
			count += 1
			break
	elif i == 0:
		b.append(a[i][1])
		count += 1
	elif i == len(a) - 1:
		if a[len(a) - 1][0] not in b:
			b.append(a[len(a) - 1][0])
			count += 1
	elif a[i] not in b:
		b.append(a[i])
		count += 1
print(count)


s = input()
if len(s) == 2:
	print('0')
else:
	array = list()
	for i in range(len(s)):
		if s[i] == ',':
			array.append(s[i - 1])
		elif s[i] == '}':
			array.append(s[i - 1])
	print(len(list(set(array))))


raw_str = input()
alphabet_arr = raw_str.replace('{', '').replace('}', '').replace(',', '').split(' ')
print(len(set(alphabet_arr)) if raw_str != '{}' else '0')


x = input()
x = x.replace('{', '')
x = x.replace('}', '')
x = x.split(', ')
dic = {}
h = 0
if x == ['']:
	x.remove('')
for each in x:
	if each not in dic:
		dic[each] = 0
print(len(dic))


x = input()
ls = ['{', ',', ' ', '}']
c = 0
ls1 = []
for i in range(len(x)):
	if x[i] not in ls:
		ls1.append(x[i])
ls2 = []
for i in range(len(ls1)):
	if ls1[i] not in ls2:
		ls2.append(ls1[i])
print(len(ls2))


s = str(input())
s = s.replace(' ', '')
s = s.replace(',', '')
s = s.replace('{', '')
s = s.replace('}', '')
s = set(s)
print(int(len(s)))


inp = input()
print(0 if inp == '{}' else len(set([x for x in inp[1:len(inp) - 1].split(', ')])))


s = input()
ls = []
for i in range(1, len(s), 3):
	if len(s) > 2 and s[i] not in ls:
		ls.append(s[i])
print(len(ls))


a = set(input().replace(', ', ''))
print(len(a) - 2)


arr = [x for x in input().replace('{', '').replace('}', '').split(', ')]
arr = list(dict.fromkeys(arr))
if arr[0] == '':
	print(0)
else:
	print(len(arr))


from math import ceil
for _ in range(1):
	letter = input()
	if letter == '{}':
		print(0)
		continue
	letter = letter[1:len(letter) - 1]
	letter = list(map(str, letter.split(', ')))
	print(len(set(letter)))


(a, l) = (input(), [])
for item in a:
	if item.isalpha():
		l.append(item)
print(len(set(l)))


line = list(input())
res = []
for sym in line:
	if sym != '{' and sym != '}' and (sym != ' ') and (sym != ',') and (sym not in res):
		res.append(sym)
print(len(res))


l = list(map(str, input().split()))
o = 0
if l == ['{}']:
	o = 1
l[0] = l[0][1:]
l[len(l) - 1] = l[len(l) - 1][0:len(l[len(l) - 1]) - 1] + ','
k = l[0]
s = 1
for i in l:
	if i not in k:
		s += 1
		k = k + i
if o == 1:
	print(0)
else:
	print(s)


s = input()
if not len(s) <= 2:
	s = s[1:len(s) - 1]
	s = s.split(',')
	l = []
	c = 0
	str = ''
	for i in s:
		str += i
	str = str.split(' ')
	for i in str:
		if i not in l:
			l.append(i)
	print(len(l))
else:
	print(0)


lists = list(filter(str.isalpha, input()))
sets = set(lists)
print(len(sets))


s = str(input())
a = set()
for i in range(0, len(s)):
	if ord('a') <= ord(s[i]) <= ord('z'):
		a.add(s[i])
print(len(a))


st = input()
st = set(list(st))
l = len(st)
if l == 3:
	print(1)
elif l == 2:
	print(0)
else:
	print(l - 4)


string = input()
if len(string) > 2:
	unique_set = list(set(string[1:-1].split(', ')))
	print(len(unique_set))
else:
	print(0)


s = set(input())
try:
	s.remove('{')
	s.remove('}')
	s.remove(',')
	s.remove(' ')
except KeyError:
	pass
print(len(s))


s = input()
s1 = []
for i in range(len(s)):
	if s[i] >= 'a' and s[i] <= 'z' or (s[i] >= 'A' and s[i] <= 'Z'):
		if s[i] not in s1:
			s1.append(s[i])
print(len(s1))


string = input()
unique = []
all = '}'
for x in string[1::3]:
	if x not in unique:
		unique.append(x)
if string[1] in all:
	print(0)
else:
	print(len(unique))


a = input()
if a == '{}':
	print(0)
else:
	b = a[1:-1].split(', ')
	b.sort()
	c = 1
	for i in range(len(b) - 1):
		if b[i] != b[i + 1]:
			c += 1
	print(c)


n = input()
p = set(n)
q = len(p) - 2
if ' ' in p:
	q -= 1
if ',' in p:
	q -= 1
print(q)


x = input()
x = x.lstrip('{')
x = x.rstrip('}')
x = x.replace(',', '')
y = x.split()
print(len(set(y)))


d = [k for k in input() if k != ',' and k != '{' and (k != '}') and (k != ' ')]
print(len(set(d)))


anton_letters = input()
if len(anton_letters[1:-1]) > 0:
	anton_letters = anton_letters[1:-1].replace(' ', '')
	print(len(set(anton_letters.split(','))))
else:
	print('0')


num = input()
arr = []
count = 1
num = num.replace(' ', '')
if len(num) == 2:
	print(0)
else:
	for i in range(0, len(num)):
		if num[i] == ',':
			arr.append(num[count:i])
			count = i + 1
		elif i == len(num) - 1:
			arr.append(num[count:len(num) - 1])
	checked = [False] * 26
	counting = 0
	for i in range(0, len(arr)):
		getting_the_ascii = ord(arr[i]) - 97
		if checked[getting_the_ascii] == False:
			checked[getting_the_ascii] = True
			counting += 1
	print(counting)


n = input()
print(len(set(n) - set('{} ,')))


str = input()
lst = []
al = 'abcdefghijklmnopqrstuvwxyz'
for i in range(len(str)):
	if str[i] in al:
		lst.append(str[i])
res = len(set(lst))
print(res)


letters = [i for i in input() if i.isalpha()]
print(len(set(letters)))


n = input()
l = set()
for i in n:
	if i != '}' and i != '{' and (i != ',') and (i != ' '):
		l.add(i)
print(len(l))


def antony(values):
	if len(values) == 2:
		return 0
	values = values[1:len(values) - 1].split(', ')
	n = len(set(values))
	return n
values = input()
print(antony(values))


s = input()
(x, ans) = (set(), 0)
for i in s:
	if ord(i) >= 65 and ord(i) <= 90 or (ord(i) >= 97 and ord(i) <= 122):
		if ord(i) not in x:
			ans += 1
			x.add(ord(i))
print(ans)


x = input()
l = [x[i] for i in range(1, len(x) - 1, 3)]
l = set(l)
print(len(l))


import sys

class Letter:

	def __init__(self, line):
		line = line[1:len(line) - 1]
		self.let = set([])
		for c in line:
			if c.islower():
				self.let.add(c)
		print(len(self.let))

def main():
	line = sys.stdin.readline().strip()
	anton = Letter(line)
main()


n = input()
s = set()
for i in n:
	if i.isalpha():
		s.add(i)
print(len(s))


n = input()
txt = n.strip('{}')
a = txt.split(', ')
b = set(a)
if b == {''}:
	print(0)
else:
	print(len(b))


s = list(input())
a = []
for i in range(len(s)):
	if ord(s[i]) >= 97 and ord(s[i]) <= 122:
		a.append(s[i])
print(len(set(a)))


a = input()
if a == '{}' or a == '{ }':
	print('0')
else:
	a = a[1:len(a) - 1]
	answ = []
	a = a.split(', ')
	for (i, x) in enumerate(a):
		if x not in answ:
			answ.append(x)
	print(len(answ))


a = input()
z = int(len(a) / 3)
b = []
for i in range(z):
	if i < len(a) - 1:
		m = 0
		for j in range(3 * i + 2, len(a)):
			if a[3 * i + 1] == a[j]:
				m += 1
		if m > 0:
			pass
		elif m == 0:
			b.append(a[3 * i + 1])
	else:
		b.append(a[3 * i + 1])
print(len(b))


x = input()
if x == '{}':
	print(0)
else:
	y = x.strip('{}')
	z = y.split(', ')
	a = set(z)
	print(len(a))


s = input()
if len(s) > 2:
	s1 = s[1:-1].split(', ')
	c = 0
	for i in range(len(s1)):
		if s1[i] not in s1[:i]:
			c += 1
	print(c)
else:
	print('0')


s = str(input())
s = s[1:-1]
n = len(s)
l = []
c = 0
for i in range(0, n, 3):
	m = s[i]
	if s[i] not in l:
		c = c + 1
		l.append(s[i])
print(c)


l = input()
a = l.strip('{}')
b = a.split(',')
c = []
for i in b:
	c.append(i.strip(' '))
for i in c:
	if i == '':
		print(0)
	else:
		print(len(set(c)))
		break


n = str(input())
dicts = {}
for i in n:
	if i not in dicts:
		dicts[i] = 1
count = 0
for (key, value) in dicts.items():
	if key == ',' or key == '{' or key == '}' or (key == ' '):
		continue
	count += 1
print(count)


s = input()
st = set()
for ch in s:
	if ch >= 'a' and ch <= 'z':
		st.add(ch)
print(len(st))


a = input()
bad = ['{', '}', ' ', ',']
for i in bad:
	a = a.replace(i, '')
ls = set(a)
l = list(ls)
print(len(l))


l = list(input())
a = 0
n = 0
ll = ['q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm']
for x in l:
	while n < 26:
		if l.count(ll[n]) > 0:
			a += 1
		n = n + 1
print(int(a))


def answer():
	a = input()[1:]
	a = a[:-1]
	a = list(a)
	a = [x for x in a if x != ' ' and x != ',']
	b = []
	for x in a:
		if x not in b:
			b.append(x)
	return len(b)
print(answer())


arr = list(str(input()))
s = set()
for ch in arr:
	if ch.isalpha():
		s.add(ch)
print(len(s))


s = input()
boo = []
for i in range(26):
	boo.append(False)
for i in range(len(s)):
	if ord(s[i]) >= 97 and ord(s[i]) <= 122:
		boo[ord(s[i]) - 97] = True
ans = 0
for i in range(26):
	if boo[i]:
		ans += 1
print(ans)


a = list(input())
k = []
k1 = []
for i in a:
	if 65 <= ord(i) <= 91 or 97 <= ord(i) <= 123:
		k.append(i)
k.remove('{')
for j in k:
	if j not in k1:
		k1.append(j)
print(len(k1))


s = input()
if ord(s[0]) == 123 and ord(s[1]) == 125:
	print(0)
elif ord(s[0]) == 123 and ord(s[2]) == 125:
	print(1)
else:
	print(len(set(s)) - 4)


def fun(e):
	return e.strip()
st = input()
st = st[1:len(st) - 1]
ary = list(map(fun, st.split(',')))
d = {}
for elem in ary:
	if elem == '':
		pass
	elif elem in d:
		pass
	else:
		d[elem] = 1
print(len(d))


letters = list(map(str, input()))
c = set()
for letter in letters:
	if letter.isalpha():
		c.add(letter)
print(len(c))


line = input()
distinct_letter = []
for char in line:
	if char == '{' or char == '}' or char == ',' or (char == ' '):
		continue
	if char in distinct_letter:
		continue
	else:
		distinct_letter.append(char)
print(len(distinct_letter))


print(len(list(set(filter(lambda x: x.isalpha(), input()[1::3])))))


ans = set()
n = input()
for i in n:
	if i != ' ' and i != ',' and (i != '{') and (i != '}'):
		ans.add(i)
print(len(ans))


data = input().strip('{').rstrip('}').split(', ')
if data != ['']:
	print(len(list(set(data))))
else:
	print(0)


r1 = input()
r = r1[0] + ' ' + r1[1:]
e = r.lstrip('{')
d = e.rstrip('}')
if d == ' ':
	print(0)
	exit(0)
l = d.split(',')
s = set(l)
print(len(s))


n = input()
if n == '{}':
	print(0)
	exit()
print(len(set(n[1:-1].split(', '))))


count2 = 0
s = input()
for i in 'abcdefghijklmnopqrstuvwxyz':
	count = s.count(i)
	if count != 0:
		count2 += 1
print(count2)


s = input()
letters = 'abcdefghijklmnopqrstuvwxyz'
count = 0
l = set()
for letter in s:
	if letter in letters and s.count(letter) == 1:
		count += 1
	elif letter in letters and s.count(letter) > 1:
		l.add(letter)
print(count + len(l))


a = set(input())
a.remove('{')
a.remove('}')
if ' ' in a:
	a.remove(' ')
	pass
if ',' in a:
	a.remove(',')
	pass
print(len(a))


a = input()
d = []
for let in a:
	d.append(let)
s = set(d)
if len(s) >= 4:
	print(len(s) - 4)
elif len(s) == 3:
	print(1)
else:
	print(0)


s = input()
li = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
for i in s:
	x = ord(i) - ord('a')
	if x >= 0 and x <= 25:
		li[x] = 1
x = sum((j for j in li))
print(x)


letter = input()
letter = set(letter)
length = len(letter)
if length == 2:
	print(0)
elif length == 3:
	print(1)
else:
	print(length - 4)


s = input()
a = ''
for i in s:
	if i not in a:
		if i.isalpha():
			a = a + i
print(len(a))


in_ = input()
splited = in_[1:-1].split(', ')
splited_set = set(splited)
filtered = filter(None, splited_set)
letters = list(filtered)
print(len(letters))


n = str(input())
list = []
l = []
for i in n[1:-1]:
	list.append(i)
for i in list:
	if i not in l and i != ' ' and (i != ','):
		l.append(i)
print(len(l))


s = input()
s = s.replace('{', '')
s = s.replace('}', '')
s = s.replace(',', '')
s = s.replace(' ', '')
s1 = ''
for i in s:
	if i not in s1:
		s1 += i
print(len(s1))


a = list(input())
b = []
for i in range(len(a)):
	if ord(a[i]) > 96 and ord(a[i]) < 123:
		b.append(a[i])
c = set(b)
print(len(c))


from sys import stdin
__author__ = 'artyom'
print(len(set([w for w in stdin.readline().strip('\n{}').split(', ') if w])))


x = input()
if len(x) == 2:
	print('0')
elif len(x) == 3:
	print('1')
else:
	y = set()
	for i in range(1, len(x), 3):
		y.add(x[i])
	print(len(y))


s = set((v for v in input().strip('{}').split(', ')))
if s == {''}:
	print(0)
else:
	print(len(s))


s = input()
data = []
for i in range(len(s)):
	if 97 <= ord(s[i]) <= 122:
		data += [s[i]]
print(len(set(data)))


s = input()
i = 1
n = len(s)
t = []
if len(s) == 2:
	print(0)
else:
	while i < n:
		t.append(s[i])
		i += 3
	t = set(t)
	print(len(t))


a = input()
letters = []
for i in a:
	if i != '{' and i != '}' and (i != ' ') and (i != ',') and (i not in letters):
		letters.append(i)
print(len(letters))


n = input()
if len(n) == 2:
	print('0')
	exit(0)
n = n[1:]
n = n[:-1]
li = []
li = n.split(', ')
unique = list(set(li))
print(len(unique))


s = input()
last = -1
L = []
if s == '{}':
	print(0)
else:
	comma = s.count(',')
	for i in range(comma + 1):
		a = s.find(',', last + 1)
		L.append(s[a - 1])
		last = a
	done = []
	for j in L:
		if j not in done:
			done.append(j)
	print(len(done))


s = input()
l = list(s)
n = set(l)
if ' ' in l:
	print(len(n) - 4)
elif l == ['{', '}']:
	print(0)
else:
	print(len(n) - 2)


a = input()
b = list()
c = ''
e = ''
g = ''
for i in range(1, len(a) - 1):
	b.append(a[i])
for i in range(0, len(b)):
	c += str(b[i])
d = c.split(',')
for i in range(0, len(d)):
	e += str(d[i])
f = e.split()
m = list(set(f))
print(len(m))


def main():
	try:
		data = list(map(str, input().replace('{', '').replace('}', '').replace(',', '').split()))
		if 1000 < len(data):
			exit(1)
		uniq = []
		ans = [uniq.append(item) for item in data if item not in uniq]
		print(len(ans))
	except:
		exit(1)
main()


letras = list(input().split(','))
letras[0] = letras[0].replace('{', '')
letras[len(letras) - 1] = letras[len(letras) - 1].replace('}', '')
if len(letras) == 1:
	if letras[0] == '':
		print(0)
	else:
		print(1)
else:
	i = 0
	while i < len(letras):
		letras[i] = letras[i].lstrip()
		i += 1
	print(len(dict.fromkeys(letras)))


n = input()
n = n[1:len(n) - 1]
n = n.split(', ')
g = []
n.sort()
n.append(0)
for i in range(len(n) - 1):
	if n[i] != n[i + 1]:
		g.append(n[i])
	else:
		continue
if '' in g:
	g.remove('')
print(len(g))


a = str(input())
a = a.lstrip('{').rstrip('}')
if len(a) == 0:
	print(0)
else:
	t = a.split(', ')
	s = {x for x in t}
	print(len(s))


a = str(input())
a = a.lstrip('{')
a = a.rstrip('}')
n = len(a)
if n == 0:
	print(0)
else:
	a = a.split(', ')
	a = list(a)
	n = len(a)
	b = []
	b.append(a[0])
	i = 1
	while i < n:
		if a[i] not in b:
			b.append(a[i])
		i = i + 1
	ans = len(b)
	print(ans)


line = input()
line = line.lstrip('{')
line = line.rstrip('}')
if len(line) == 0:
	print(0)
else:
	L = line.split(',')
	set = []
	for i in range(len(L)):
		letter = L[i].strip(' ')
		if not letter in set:
			set.append(letter)
	print(len(set))


list1 = input()
list2 = []
m = 0
for k in list1:
	m = m + 1
if m == 2:
	print('0')
elif m == 3:
	print('1')
elif m > 3:
	for k in list1:
		if k not in list2:
			list2.append(k)
	print(len(list2) - 4)


from string import ascii_lowercase
ff = []
a = str(input())
for i in a:
	if i in list(ascii_lowercase):
		ff.append(i)
print(len(set(ff)))


from sys import stdin
s = stdin.readline().strip('{}\n').split(', ')
res = set()
for c in s:
	if c:
		res.add(c)
print(len(res))


alp = input().replace('{', '').replace(', ', '').replace('}', '')
print(len(set([char for char in alp])))


s = input()
l = list(s[1:len(s) - 1].strip().split(', '))
d = {}
for i in l:
	if i not in d and i.isalpha():
		d[i] = 1
cnt = 0
for i in d:
	cnt += 1
if s == '':
	print('0')
else:
	print(cnt)


n = input()
if n == '{}':
	print(0)
else:
	l = set()
	for i in n:
		if i.isalpha():
			l.add(i)
	print(len(l))


string = input()
word_dic = {}
for chars in string:
	if chars == '{' or chars == '}' or chars == ',' or (chars == ' '):
		continue
	elif chars not in word_dic.keys():
		word_dic[chars] = 1
	else:
		word_dic[chars] += 1
print(len(word_dic.keys()))


s = input()
if len(s) == 2:
	print(0)
else:
	z = s.split(', ')
	z[0] = z[0][1]
	z[len(z) - 1] = z[len(z) - 1][0]
	z.sort()
	t = set(z)
	print(len(t))


str = input()
a = {x for x in str[1:len(str) - 1:3]}
print(len(a))


def countLetter(string):
	count = 0
	dictLetter = {}
	for i in string:
		if len(i) == 2:
			if '{}' in str(i):
				return 0
			if '}' in str(i):
				i = str(i[0])
			if '{' in str(i):
				i = str(i[1])
		if str(i) not in dictLetter:
			dictLetter[str(i)] = 0
			count += 1
	return count
string = input().split(', ')
print(countLetter(string))


def remove(string):
	return string.replace(' ', '')
string = str(input())
string = remove(string)
l = list(string[1:-1].split(','))
print(len(set(l)) - l.count(''))


s = input()
arr = s[1:len(s) - 1].split(', ')
if len(s) == 2:
	print(0)
else:
	print(len(set(arr)))


print(len(set(filter(None, input().strip('{}').split(', ')))))


s = input()
s1 = ''.join((i for i in s if i not in ['{', '}']))
l = list(s1.split(', '))
if l != ['']:
	print(len(set(l)))
else:
	print(0)


ar = set(input(''))
ar = set(ar)
ar.remove('{')
ar.remove('}')
my = ' ,'
final = [each for each in ar if each in my]
if len(final) > 0:
	print(len(ar) - 2)
else:
	print(len(ar))


n = input()
j = '{}, '
p = ''
s = 0
for i in n:
	if i not in j and i not in p:
		s += 1
		p += i
print(s)


ins = input()
print(len(set(list(ins.replace('}', '').replace('{', '').replace(' ', '').replace('\n', '').split(','))) if set(list(ins.replace('}', '').replace('{', '').replace(' ', '').replace('\n', '').split(','))) != {''} else []))


a = input()
a = a[1:len(a) - 1]
a = a.replace(' ', '')
a = a.replace(',', '')
mem = ''
t = 0
for c in a:
	if not c in mem:
		mem += c
		t += 1
print(t)


l = list(input())
l = list(set(l))
res = len(l) - 2
if ',' in l:
	res = res - 1
if ' ' in l:
	res = res - 1
print(res)


string = input()
string = string.replace(',', '')
x = len(set((char for char in string.lower() if char.islower())))
print(x)


line = input()[1:-1].split(', ')
if len(line) == 1:
	if not line[0].isalpha():
		line.remove(line[0])
print(len(set(line)))


s = input()
a = [0] * 27
for c in s:
	if c == ' ' or c == '{' or c == '}' or (c == ','):
		continue
	a[ord(c) - ord('a')] += 1
ans = 0
for i in a:
	if i > 0:
		ans += 1
print(ans)


s = input()
ch = [0] * 26
count = 0
for i in range(1, len(s) - 1, 3):
	ch[ord(s[i]) - ord('a')] += 1
for i in ch:
	if i is not 0:
		count += 1
print(count)


a = input()
a = a.replace(' ', '')
l = len(a)
modif_str = a[1:l - 1]
if len(modif_str) == 0:
	print(0)
else:
	modif_str = modif_str.split(',')
	set_str = set(modif_str)
	print(len(set_str))


word = input()
mylist = []
for c in word:
	if c != '{' and c != '}' and (c != ' ') and (c != ','):
		if c not in mylist:
			mylist.extend(c)
print(len(mylist))


s = input()
s = s.strip('{}')
s = s.replace(',', ' ')
l = s.split()
t = set(l)
print(len(t))


z = input().lower()
b = []
for i in z:
	if 65 <= ord(i) <= 122 and i not in b:
		b.append(i)
print(len(b))


x = str(input())
c = [x[1]]
s = 0
for i in range(4, len(x) - 1, 3):
	c.append(x[i])
if x[1] == '}':
	print('0')
else:
	print(len(set(c)))


a = [',', ' ', '}', '{']
n = set((i for i in input() if i not in a))
print(len(n))


str = input()
strlist = list(str)
myset = set()
for i in strlist:
	if i != '{' and i != ',' and (i != '}') and (i != ' '):
		myset.add(i)
print(len(myset))


print(len(set(filter(None, input()[1:-1].split(', ')))))


s = input()[1:-1].split(', ')
ns = []
for c in s:
	if c >= 'a' and c <= 'z' and (c not in ns):
		ns.append(c)
print(len(ns))


a = set(input())
try:
	a.remove('{')
	a.remove('}')
	a.remove(' ')
	a.remove(',')
except:
	pass
print(len(a))


s = input()
st = s[1:len(s) - 1]
l = st.split(',')
listToStr = ' '.join([str(elem) for elem in l])
s1 = set(listToStr)
string = ' '.join({str(elem) for elem in s1})
l1 = string.count(' ')
print(len(string) - l1)


import re

def main():
	s = input()
	s = s[1:len(s) - 1]
	if len(s) > 0:
		mlist = re.split(', ', s)
		print(len(set(mlist)))
	else:
		print(0)
main()


s = input()
if len(s) > 2:
	s = s.lstrip('{')
	s = s.rstrip('}')
	s = s.replace(',', '')
	k = set(s.split(' '))
	print(len(k))
else:
	print(0)


a = input()
if a == '{}':
	print(0)
else:
	a = a.replace('{', '')
	a = a.replace('}', '')
	a = set(a.split(', '))
	print(len(a))


print(len(set([x for x in input()[1:-1][::3]])))


s = input()
s1 = s[1:len(s) - 1]
list = []
for i in range(0, len(s1), 3):
	list.append(s1[i])
list.sort()
dis = len(list)
for j in range(len(list) - 1):
	if list[j] == list[j + 1]:
		dis = dis - 1
print(dis)


a = input()
j = set()
for i in a:
	if i.islower():
		j.add(i)
print(len(j))


n = list(input())
num = list()
for i in range(len(n)):
	if n[i] != '{' and n[i] != ',' and (n[i] != ' ') and (n[i] != '}'):
		num.append(n[i])
print(len(set(num)))


def solve():
	mas = {s for s in input()[1:-1].split(', ') if s != ''}
	print(len(mas))
solve()


given = input().strip()[1:-1]
letters = set()
for char in given:
	if char not in '{}, ':
		letters.add(char)
print(len(letters))


s1 = input()
s2 = ''
i = 1
n = 0
while i < len(s1):
	if s1[i] in s2 or s1[i] in '{}':
		n += 0
	else:
		n += 1
	s2 += s1[i]
	i += 3
print(n)


s = input()
if s == '{}':
	print('0')
else:
	s = s[1:-1]
	split_s = list(s.split(', '))
	split_s = set(split_s)
	print(len(split_s))


letters = input()
letters = letters.replace('{', '').replace('}', '')
letters = letters.split(', ')
counted = []
count = 0
for letter in letters:
	if not letter == '':
		if not letter in counted:
			count = count + 1
			counted.append(letter)
print(count)


n = set(input())
l = ''.join((x for x in n if x.isalpha() == True))
print(len(l))


r = len(set(input())) - 4
if r == -2:
	print(0)
elif r == -1:
	print(1)
else:
	print(r)


from sys import stdin
import re
s = stdin.readline().rstrip()
p = s.split('{')
k = p[1].split('}')
l = k[0].split(',')
d = {}
for i in l:
	if i in d:
		d[i.strip()] += 1
	else:
		d[i.strip()] = 1
c = 0
for i in d.keys():
	if i != '':
		c += 1
print(c)


s = input().strip()
i = 1
L = []
while i <= len(s) - 2:
	if s[i] not in L:
		L.append(s[i])
	i = i + 3
print(len(L))


inp = input()
inp = inp[1:-1]
inp = inp.split(',')
l = []
for letters in inp:
	for num in letters:
		if num not in l and num != ' ':
			l.append(num)
print(len(l))


a = input()
l = [x for x in a if x.isalpha() == True]
l_new = list()
for x in l:
	if (x in l_new) == False:
		l_new.append(x)
	else:
		pass
print(len(l_new))


t = input()
list = []
k = 0
for i in range(0, len(t)):
	str = t[i]
	if str.isalpha():
		for j in range(0, len(list)):
			if list[j] == t[i]:
				k = 1
		if k == 0:
			list.append(t[i])
	k = 0
print(len(list))


a = input().strip().lstrip()
if a == '{}':
	print(0)
	exit(0)
a = a[1:-1].split(',')
l = set()
for i in a:
	l.add(i.strip())
print(len(l))


n = input().strip().split()
a = []
for i in str(n):
	if i.isalpha():
		a.append(i)
print(len(set(a)))


s = input()
res = set()
ignore = ('{', '}', ',', ' ')
for c in s:
	if c not in ignore:
		res.add(c)
print(len(res))


n = input()
a = []
i = 1
if len(n) > 2:
	while i < len(n):
		a.append(n[i])
		i += 3
c = set(a)
print(len(c))


set_input = input()
dict_input = {}
for element in set_input:
	if element.isalpha():
		dict_input[element] = None
print(len(dict_input))


n = input()
s = '{}, '
seq = []
for i in n:
	if i not in s and i not in seq:
		seq.append(i)
print(len(seq))


s = input()
s1 = s.replace(' ', '')
s2 = s1.replace(',', '')
s3 = s2.replace('{', '')
s4 = s3.replace('}', '')
s5 = set(s4)
print(len(s5))


a = str(input())
b = list(''.join(a))
c = [i for i in b if i.isalpha()]
print(len(set(c)))


m = set(input())
if len(m) == 2:
	print(len(m) - 2)
elif len(m) == 3:
	print(len(m) - 2)
else:
	print(len(m) - 4)


s = input()
d = [0] * 26
for i in s:
	if i.isalpha():
		d[ord(i) - 97] = 1
print(sum(d), end='')


n = input()
l = len(n)
d = {}
for i in range(l):
	if n[i] >= 'a' and n[i] <= 'z':
		if n[i] in d:
			d[n[i]] += 1
		else:
			d[n[i]] = 1
print(len(d.keys()))


a = list(input())
b = []
alpha = 'abcdefghijklmnopqrstuvwxyz'
for i in range(len(a)):
	if a[i] in alpha:
		if a[i] not in b:
			b.append(a[i])
print(len(b))


c = str(input())
temp_list = list()
c = c.replace(' ', '').replace(',', '').replace('{', '').replace('}', '')
counter = 0
for elem in c:
	if elem not in temp_list:
		counter += 1
		temp_list.append(elem)
print(counter)


a = {x: 1 for x in input() if x.isalpha()}
print(len(a))


import string
str_input = input()
new_str = ''
for ch in str_input:
	if ch in string.ascii_letters and ch not in new_str:
		new_str += ch
print(len(new_str))


s = input()
new_s = s[1:-1].split(', ')
new_s = set(new_s)
ln_s = len(new_s)
if s == '{}':
	ln_s = 0
print(ln_s)


S = input()
SS = list()
for i in S:
	if i.isalpha():
		SS += [i]
print(len(set(SS)))


x = input().replace(',', '')
x = x.replace('{', '')
x = x.replace('}', '')
x = x.replace(' ', '')
myset = set(x)
print(len(myset))


a = input()
l = len(a)
x = list(filter(None, set(a[1:l - 1].split(', '))))
print(len(x))


a = input()
f = ' '.join(a)
k = f.split()
f = []
if '{' and '}' in k:
	k.remove('{')
	k.remove('}')
g = k[:]
for i in range(len(g)):
	if ',' in g:
		g.remove(',')
print(len(set(g)))


setStr = input()
if setStr == '{}':
	print(0)
	quit()
list_pri = setStr[1:-1]
ls = set(list_pri.split(', '))
print(len(ls))


a = list(input())
w = 'qwertyuiopasdfghjklzxcvbnm'
e = []
for i in a:
	if i in w:
		e.append(i)
print(len(set(e)))


a = input()
b = set()
for i in a:
	if i.isalpha():
		b.add(i)
x = b.__len__()
print(x)


s = list(set(str(input()).strip(' ')))
new_list = []
for i in range(len(s)):
	if not (s[i] == '{' or s[i] == '}' or s[i] == ' ' or (s[i] == ',')):
		new_list.append(s[i])
print(len(new_list))


s = input()
if s == '{}':
	print(0)
else:
	a = s[1:-1]
	a = a.split(', ')
	l = set(a)
	print(len(l))


lst = list(input())
del lst[0]
del lst[-1]
word = ''.join(lst)
lst = [i.strip() for i in word.split(',')]
i = 0
lst.sort()
while i < len(lst) - 1:
	if lst[i] == lst[i + 1]:
		del lst[i + 1]
	else:
		i += 1
if lst == ['']:
	print(0)
else:
	print(len(lst))


str = input()
x = str.replace('}', '')
str = x.replace('{', '')
count = 0
lst = str.split(', ')
lst.sort()
i = 0
if '' in lst:
	print(count)
else:
	count = 1
	while i < len(lst) - 1:
		if lst[i] != lst[i + 1]:
			count += 1
		i += 1
	print(count)


L = input()
s = L.translate(str.maketrans('{,}', '   '))
s1 = set(s.split())
print(len(s1))


letters = input()
letters = letters[1:-1]
letters = letters.split(', ')
freq = {}
for l in letters:
	if l != '':
		if l in freq:
			freq[l] += 1
		else:
			freq[l] = 1
print(len(freq))


s = map(str, input())
s = list(s)
l = []
count = 0
for i in s:
	if i.isalpha():
		if i not in l:
			l.append(i)
			count += 1
print(count)


n = input()
size = len(n)
cnt = 0
ans = {''}
for x in range(size):
	if n[x] >= 'a' and n[x] <= 'z':
		ans.add(n[x])
print(len(ans) - 1)


br = input()
brs = set(br.strip('{}').split(', '))
if brs == {''}:
	print(0)
else:
	print(len(brs))


words = input()
l = []
for char in words:
	if char != '{' and char != '}' and (char != ' ') and (char not in l) and (char != ','):
		l += char
print(len(l))


chars = input()
if chars == '{}':
	print('0')
else:
	chars = chars[1:-1]
	chars = chars.split(',')
	setOfChars = set()
	left = 0
	right = len(chars) - 1
	while left <= right:
		lw = chars[left].strip()
		rw = chars[right].strip()
		if lw not in setOfChars:
			setOfChars.add(lw)
		if rw not in setOfChars:
			setOfChars.add(rw)
		left += 1
		right -= 1
	print(len(setOfChars))


s = set([x for x in input()[1:-1].split(', ') if x])
print(len(set(s)))


if 1:
	from string import *
	print(len({x for x in input() if x in ascii_lowercase}))


line = set(input())
if len(line) == 2:
	print('0')
if len(line) == 3:
	print('1')
if len(line) > 3:
	print(len(line) - 4)


t = input('')
s = t[1:len(t) - 1]
a = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
ctr = 0
for i in range(0, len(s)):
	if s[i] != ' ' and s[i] != ',':
		l = ord(s[i]) - 97
		a[l] = a[l] + 1
		if a[l] == 1:
			ctr = ctr + 1
print(ctr)


s = input()
if s == '{}':
	print(0)
else:
	print(len(dict.fromkeys(s[1:-1].split(', '))))


a = input()
b = dict()
for i in a:
	if i == '{' or i == '}' or i == ',' or (i == ' '):
		pass
	else:
		b[i] = 1
c = list(b.keys())
print(len(c))


s = input()
ans = set()
for c in s:
	if ord(c) >= ord('a') and ord(c) <= ord('z'):
		ans.add(c)
print(len(ans))


x = list(input())
x = set([i for i in x if i not in '{}, '])
print(len(x))


s = list(input())
s = s[1:-1]
x = []
for i in s:
	if i != ' ' and i != ',':
		x.append(i)
s = set(x)
print(len(s))


IN = input().split(', ')
IN[0] = IN[0][1]
IN[len(IN) - 1] = IN[len(IN) - 1][0]
ans = int(0)
if len(IN) == 1:
	if ord(IN[0]) >= 65 and ord(IN[0]) <= 90 or (ord(IN[0]) <= 122 and ord(IN[0]) >= 97):
		ans += 1
	else:
		ans += 0
else:
	IN.sort(key=ord)
	ans += 1
	for i in range(1, len(IN)):
		if IN[i] != IN[i - 1]:
			ans += 1
print(ans)


s = input()
d = set()
for i in range(len(s)):
	if s[i].isalpha():
		d.add(s[i])
print(len(d))


l = list(input().strip())
res = []
for e in l:
	if e != '{' and e != ',' and (e != ' ') and (e != '}'):
		res.append(e)
res = set(res)
print(len(res))


l = list(input().split(', '))
first = l[0]
l[0] = first[1]
last = l[-1]
l[-1] = last[0]
v = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
n = []
for element in v:
	if element in l:
		n.append(element)
print(len(n))


from collections import Counter as c
n = c(input())
del n[' ']
del n[',']
del n['{']
del n['}']
print(len(n.values()))


def unique(listx):
	uniquelist = []
	for x in listx:
		if x not in uniquelist:
			uniquelist.append(x)
	print(len(uniquelist))
n = input()
stringlist = n[1:-1]
stringlist = stringlist.replace(',', '')
stringlist = stringlist.replace(' ', '')
unique(stringlist)


import math
INF = 1000000000.0

def isLetter(a):
	if ord(a) >= ord('a') and ord(a) <= ord('z') or (ord(a) >= ord('A') and ord(a) <= ord('Z')):
		return True
	return False

def main():
	s = input()
	t = [0] * 400
	cnt = 0
	for i in range(len(s)):
		if isLetter(s[i]) and t[ord(s[i]) - ord('A')] == 0:
			t[ord(s[i]) - ord('A')] = 1
			cnt += 1
	print(cnt)
main()


n = list(input())
a = set(n[1:len(n) - 1])
if len(a) > 1:
	print(len(a) - 2)
else:
	print(len(a))


args = input().lstrip('{')
args = args.rstrip('}')
args = args.split(', ')
args = ''.join(args)
answer = len(set(args))
print(answer)


a = input()
b = []
for i in a[1:len(a) - 1]:
	if i.isalpha() and i not in b:
		b.append(i)
print(len(b))


s = set()
ss = input()
for i in ss:
	s.add(i)
a = len(s)
if ' ' in ss:
	a = a - 1
if ',' in ss:
	a = a - 1
print(a - 2)


used = []
a = input().replace('{', '').replace('}', '').replace(' ', '').split(',')
if a == ['']:
	print('0')
else:
	for b in a:
		if b not in used:
			used.append(b)
	print(len(used))


s = input().strip('{').strip('}').split(', ')
k = len(set(s)) - s.count('')
print(k)


a = str(input())
alist = list(map(str, a))
alist.sort()
a2 = list(set(alist))
ans = []
for s in a2:
	if s.isalpha() is True:
		ans += s
print(len(ans))


x = input()
x = x[1:]
x = x[:-1]
x = x.split(', ')
u = []
for i in x:
	if i not in u and i != '':
		u.append(i)
print(len(u))


n = input()
a = n.replace('{', ' ')
b = a.replace('}', '')
c = b.replace(',', '')
d = set(c)
print(len(d) - 1)


s = set()
for x in input():
	n = ord(x)
	if n >= 97 and n <= 122:
		s.add(x)
print(len(s))


s = input().replace(',', '').replace('{', '').replace('}', '').replace(' ', '')
a = 0
while len(s) != 0:
	a = a + 1
	s = s.replace(s[0], '')
	if s == '' or s == ' ':
		break
print(a)


n = list(input())
n.remove('{')
n.remove('}')
while ',' in n:
	n.remove(',')
while ' ' in n:
	n.remove(' ')
a = set(n)
print(len(a))


s = input()
delete = ['{', '}', ' ', ',']
for i in delete:
	s = s.replace(i, '')
st = set(s)
a = list(st)
print(len(a))


str = input()
str = str.replace('{', '')
str = str.replace('}', '')
list1 = list(str.split(', '))
list_set = set(list1)
unique_list = list(list_set)
if list1[0] == '':
	print(0)
else:
	print(len(unique_list))


r = input()
if r == '{}':
	print(0)
else:
	s = list(r)
	s.pop(0)
	s.pop(-1)
	t = ''.join(s)
	u = t.split(', ')
	v = set(u)
	print(len(v))


x = input()
s = set()
for ch in x:
	if ch.isalpha():
		s.add(ch)
print(len(s))


s = input()
if s == '{}':
	print(0)
elif len(s) == 3:
	print(1)
else:
	lettres = s.split()
	lettres[0] = lettres[0][1]
	for i in range(1, len(lettres)):
		lettres[i] = lettres[i][0]
		diff = set()
	for i in range(len(lettres)):
		diff.add(lettres[i])
	print(len(diff))


stra = input()
stra = stra[1:len(stra) - 1]
lista = list(stra)
seta = set()
for i in range(0, len(lista)):
	if not (lista[i] == ' ' or lista[i] == ','):
		seta.add(lista[i])
ansa = 0
for i in seta:
	ansa += 1
print(ansa)


import sys
userinput = sys.stdin.readline().rstrip().lower()
x = len(list(set(userinput)))
int(x)
y = x - 4
if y >= 0:
	print(y)
else:
	print(x - 2)


letter_set = input()
letter_set = letter_set[1:-1]
if letter_set == '':
	print(0)
else:
	all_letters = letter_set.split(', ')
	distinct_letters = set(all_letters)
	print(len(distinct_letters))


letters = input()[1:-1]
letters = letters.split(', ')
letters = set([letter for letter in letters if letter != ''])
print(len(letters))


print(len(set(map(lambda c: c if c.isalpha() else '.', str(input())))) - 1)


a = input()
b = set()
for x in a:
	if x.isalpha() == True:
		b.add(x)
print(len(b))


String = set(input())
String -= {'{', '}', ' ', ', ', ','}
print(len(String))


caracteres = []
linha = input()
for i in linha:
	if 97 <= ord(i) <= 122:
		if i not in caracteres:
			caracteres.append(i)
print(len(caracteres))


l = list(input())
l.pop(0)
l.pop(-1)
h = list(set(l))
a1 = len(h)
if a1 == 0:
	print(0)
elif a1 == 1:
	print(a1)
else:
	print(a1 - 2)


ch = input()
ch1 = ' ' + ch[1:-1]
e = list(set(list(ch1.split(','))))
if e[0] != ' ':
	print(len(e))
else:
	print(0)


s = input()
x = 0
j = []
for e in s[1:-1]:
	if x % 3 == 0:
		j.append(e)
	x += 1
print(len(set(j)))


s = input().strip('{').strip(',').strip('}').split(', ')
for i in s:
	if i == '':
		s.remove(i)
sx = set(s)
count = 0
for i in sx:
	count += 1
print(count)


seto = input()
apar = ''
contador = 0
for letra in seto:
	if letra == '}':
		break
	if not letra in apar and letra not in '{}, ':
		contador += 1
		apar += letra
print(contador)


latin_w = list(input().split())
latin_w = [c.strip(',{}') for c in latin_w if c.strip(',{}') != '']
print(len(set(latin_w)))


letters = list(map(str, input().split(', ')))
seprated_letters = list()
final = list()
i = 0
while i < len(letters):
	if '{}' in letters[i]:
		letters.remove('{}')
	elif '{' in letters[i]:
		seprated_letters.append(letters[i][1])
	elif '}' in letters[i]:
		seprated_letters.append(letters[i][0])
	else:
		seprated_letters.append(letters[i])
	i += 1
for letter in seprated_letters:
	if letter in final:
		continue
	else:
		final.append(letter)
print(len(final))


words = str(input()[1:-1])
hashlist = {}
for c in words:
	if c != ',' and c != ' ':
		if c not in hashlist.keys():
			hashlist[c] = 1
print(len(hashlist))


n = input()
x = dict()
for l in n:
	if l != '{' and l != '}' and (l != ' ') and (l != ','):
		if l in x:
			x[l] += 1
		else:
			x[l] = 1
print(len(x))


s = input()
ss = set(s)
if len(ss) > 4:
	print(len(ss) - 4)
elif len(ss) == 3:
	print(1)
else:
	print(0)


inp = input().replace('{', '').replace('}', '')
if len(inp.strip()) == 0:
	print(0)
	exit(0)
res = set()
for letter in inp.split(','):
	res.add(letter.strip())
print(len(res))


word = list(input())
word = word[1:]
word = word[:-1]
num = int((len(word) + 2) / 3)
abc = []
for i in range(num):
	abc.append(word[3 * i])
set1 = set(abc)
print(int(len(set1)))


a = input()
b = len(a)
su = 0
if b == 2:
	print(0)
else:
	c = 26 * [0]
	for i in range(1, b - 1, 3):
		d = ord(a[i])
		c[d - 97] += 1
	for j in range(0, 26):
		if c[j] > 0:
			su += 1
	print(su)


n = input()
set = set(n)
k = 0
for x in set:
	k += 1
if ',' and ' ' in set:
	print(k - 4)
else:
	print(k - 2)


st = input()
if st == '{}':
	print(0)
else:
	st_li = st[1:-1].split(', ')
	print(len(set(st_li)))


p = input().strip()
q = []
for i in range(len(p)):
	if p[i].isalpha():
		q.append(p[i])
print(len(set(q)))


s = input().split()
S = set()
if len(s) == 1 and len(s[0]) == 2:
	print(0)
elif len(s) == 1 and len(s[0]) == 3:
	print(1)
else:
	S.add(s[0][1:2])
	for e in s[1:]:
		S.add(e[0:1])
	print(len(S))


s = list(str(input()))
st = []
for ch in s:
	if ch.isalpha():
		st.append(ch)
print(len(set(st)))


import string
lowcase = string.ascii_lowercase
letter = input()
target = set([char for char in letter if char in lowcase])
print(len(target))


s = input()
s = s[1:-1]
c = s.split(', ')
b = []
for x in c:
	if x == '':
		break
	if not x in b:
		b.append(x)
print(len(b))


s = set(input())
res = set()
for i in s:
	if i.isalpha():
		res.add(i)
print(len(res))


x = input()
arr = x.replace(' ', '').split('{')[1].split('}')[0]
if arr == '':
	arr = []
else:
	arr = arr.split(',')
D = {}
for a in arr:
	D[a] = 1
print(len(D))


l = input()
if len(l) == 2:
	print(0)
else:
	l1 = set()
	for i in l:
		l1.add(i)
	l1.remove('{')
	l1.remove('}')
	if ',' in l1:
		l1.remove(',')
	if ' ' in l1:
		l1.remove(' ')
	print(len(l1))


s = input()
a = []
for i in s:
	if i.isalpha() == True:
		a.append(i)
a = set(a)
print(len(a))


s = input()
s = s.strip('}')
s = s.strip('{')
s = s.split(', ')
if len(set(s)) == 1 and s[0] == '':
	print(0)
	quit()
print(len(set(s)))


s = input()
a = [' ']
for i in s[1:-1]:
	if i != ' ' and i != ',':
		j = 0
		for j in range(len(a)):
			if i == a[j]:
				break
		if a[j] != i:
			a.append(i)
print(len(a) - 1)


c = []
v = []
q = []
s = 0
x = input().split(',')
if len(x) <= 1000:
	for z in x:
		c.append(z)
	for m in c:
		v.append(c[s][1])
		s += 1
	if ord(max(v)) < 123 and ord(min(v)) > 96:
		for n in v:
			if n not in q:
				q.append(n)
	print(len(q))


from collections import Counter
s = input()[1:-1].strip()
s = filter(lambda x: x != '', map(lambda x: x.strip(), s.split(',')))
print(len(Counter(s)))


row = input()[1:-1]
print(len(set(row.split(', '))) if len(row) else 0)


string = input()
string = string[1:-1]
if len(string) is 0:
	print(0)
else:
	string = string.replace(' ', '')
	l = string.split(',')
	print(len(set(l)))


a = input()
b = list(set(a))
if '{' in b:
	del b[b.index('{')]
if ' ' in b:
	del b[b.index(' ')]
if '}' in b:
	del b[b.index('}')]
if ',' in b:
	del b[b.index(',')]
print(len(b))


set = input()
set = set.replace('{', '')
set = set.replace('}', '')
set = set.replace(' ', '')
list = list(set.split(','))
if '' in list and len(list) == 1:
	print(0)
else:
	dict = {}
	for i in list:
		if i in dict:
			dict[i] += 1
		else:
			dict[i] = 1
	print(len(dict))


s = set([e for e in input() if e.isalnum()])
print(len(s))


x = input()
if x == '{}':
	print(0)
	exit()
x = x.replace('{', '').replace('}', '').split(', ')
z = set(x)
print(len(z))


a = list(input())
a.remove(a[0])
a.remove(a[-1])
ls = []
count = 0
for i in range(len(a)):
	if a[i] not in ls and a[i] != ' ' and (a[i] != ','):
		count += 1
	ls.append(a[i])
print(count)


s = list(set(input()[1:-1].split(', ')))
c = 0
for i in s:
	if i != '':
		c += 1
print(c)


letter = input()
letter = letter.strip('{}')
let = []
for i in range(len(letter)):
	if i % 3 == 0:
		let.append(letter[i])
lett = len(set(let))
print(lett)


sett = []
word = input()
if word == '{}':
	print(0)
else:
	word1 = list(word)
	for w in range(1, len(word1), 3):
		sett.append(word1[w])
	settt = set(sett)
	print(len(settt))


x = input()
y = x[1:-1].split(', ')
unique = y[0]
for i in y:
	if (i in unique) == False:
		unique += i
print(len(unique))


str = input()
s = set()
for c in str:
	if c.isalpha():
		s.add(c)
print(len(s))


l1 = input()
l = [i for i in l1 if i.isalpha()]
print(len(set(l)))


string = input()
s = set()
for i in string:
	if i.isalpha():
		if i not in s:
			s.add(i)
print(len(s))


s = input()
l = []
from collections import Counter
for i in s:
	if i <= 'z' and i >= 'a':
		l.append(i)
print(len(Counter(l)))


l = list(set(input()))
k = 0
for i in range(0, len(l)):
	if ord(l[i]) in range(97, 123):
		k += 1
print(k)


s = str(input())
letters = []
count = 1
if len(s) > 2:
	for i in range(0, len(s) - 1, 1):
		if s[i].isalpha():
			letters.append(s[i])
	for i in range(1, len(letters), 1):
		if sorted(letters)[i] != sorted(letters)[i - 1]:
			count += 1
	print(count)
else:
	print(0)


a = str(input())
list1 = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
list2 = []
c = 0
for i in a:
	if i in list1 and i not in list2:
		list2 = list2 + [i]
		c += 1
	if i in list1 and i not in list2:
		c += 1
print(c)


girdi = input()[1:-1]
girdi = girdi.replace(' ', '')
girdi = girdi.split(',')
ex = []
num = 0
for _ in girdi:
	if not ex.__contains__(_) and _ != '':
		ex.append(_)
		num += 1
print(num)


s = input()
s = list(s)
lst = []
for i in s:
	if i.isalpha() and i not in lst:
		lst.append(i)
print(len(lst))


try:
	s = input()
	l = len(s)
	new = ''
	for i in range(l):
		if s[i] != ' ' and s[i] != '{' and (s[i] != '}') and (s[i] != ',') and s[i].islower():
			if s[i] not in s[i + 1:]:
				new += s[i]
	print(len(new))
except:
	pass


f_input = str(input())
f_input_l = f_input.replace('}', '')
f_input_ls = f_input_l.replace('{', '')
f_input_f = f_input_ls.split(', ')
x = 0
answer = 0
while x < len(f_input_f):
	z = f_input_f[x]
	if z.isalpha():
		f_input_f = str(f_input_f).replace(z, '')
		answer += 1
	else:
		x += 1
print(answer)


letters_ori = input()
letters = letters_ori[1:-1]
L = letters.split(', ')
(num, letters_new) = (0, [''])
for i in L:
	if i not in letters_new:
		num += 1
		letters_new.append(i)
print(num)


a = input()
l1 = []
for i in a:
	if ord(i) >= 97 and ord(i) <= 122:
		l1.append(i)
s1 = set(l1)
print(len(s1))


y = list(set(map(str, input().strip())) - {'{', '}', ',', ' '})
print(len(y))


a = input()
l = a[1:len(a) - 1].split(', ')
d = {}
sum = 0
for i in l:
	if i not in d and i != '':
		sum += 1
		d[i] = 1
print(sum)


s = input()
if len(s) == 2:
	print(0)
else:
	s = s[1:-1].replace(' ', '')
	li = s.split(',')
	table = {}
	for elem in li:
		if elem in table:
			table[elem] += 1
		else:
			table[elem] = 1
	print(len(table))


set = input()
set1 = set.replace('{', '')
set1 = set1.replace('}', '')
letters = set1.split(', ')
count = 0
new = []
for i in range(len(letters)):
	if letters[i] not in new:
		count += 1
		new.append(letters[i])
if set != '{}':
	print(count)
else:
	print(0)


a = input()
s = set()
for i in a:
	if ord(i) in range(97, 123):
		s.update(i)
print(len(s))


a = set(input())
a.remove('{')
a.remove('}')
if len(a) > 2:
	a.remove(' ')
	a.remove(',')
print(len(a))


n = input()
unique = set()
for char in n:
	if char != '{' and char != '}' and (char != ' ') and (char != ','):
		unique.add(char)
print(len(unique))


b = str(input())
i = 1
dif = 0
encontrado = 0
if b[i] == '}':
	print(0)
else:
	while i < len(b):
		letrita = b[i]
		j = 1
		while j < i and (not encontrado):
			if b[j] == letrita:
				encontrado = 1
			j += 3
		if not encontrado:
			dif += 1
		i += 3
		encontrado = 0
	print(dif)


import re
n = input()
word = re.compile('\\w')
w = word.findall(n)
ans = set(w)
print(len(ans))


s = input()
s1 = s[1:len(s) - 1].replace(',', ' ')
l = len(list(set(s1.split())))
print(l)


string = input()
if len(string) == 2:
	print(0)
else:
	string = string[1:len(string) - 1]
	chars = string.split(', ')
	arr = [0 for i in range(26)]
	for i in chars:
		arr[ord(i) - 97] += 1
	count = 0
	for i in arr:
		if i > 0:
			count += 1
	print(count)


n = input()
l = []
for i in range(len(n)):
	if n[i].isalpha():
		l.append(n[i])
print(len(list(set(l))))


n = set(input())
if len(n) == 2 or len(n) == 3:
	print(len(n) - 2)
	exit()
print(len(n) - 4)


word = input()
count = 0
from string import ascii_lowercase
for c in ascii_lowercase:
	if c in word:
		count += 1
print(count)


txt = set(input())
if ',' in txt:
	print(len(txt) - 4)
else:
	print(len(txt) - 2)


from string import ascii_letters

def get_values():
	string = list(input())
	letters = [m for m in string if m in ascii_letters]
	res = []
	for i in letters:
		if i not in res:
			res.append(i)
	return print(len(res))
get_values()


from collections import Counter
s = input()
s = s[1:-1].split(', ')
length = len(s)
if s[0] != '':
	cou = Counter(s)
	print(len(cou.most_common(length)))
else:
	print(0)


my = input()
index = 0
final = []
while my[index] != my[-1]:
	if my[index].isalpha() == True:
		final.append(my[index])
	index += 1
print(len(set(final)))


arr = list(input())
s = 'qwertyuiopasdfghjklzxcvbnm'
c = 0
st = set(arr)
for i in st:
	if i in s:
		c += 1
print(c)


values = input()
g = set()
for i in values:
	if i >= 'a' and i <= 'z':
		g.add(i)
print(len(g))


a = input()
b = list(''.join(a.split(', ')))
del b[-1]
del b[0]
c = set(b)
print(len(c))


a = list(map(str, input().split(',')))
a[0] = a[0].strip('{')
a[len(a) - 1] = a[len(a) - 1].strip('}')
b = dict()
value = 0
ans = 0
for i in a:
	i = i.lstrip()
	if i in b:
		value = b[i]
		b[i] = value + 1
	else:
		b[i] = 1
if b.get(''):
	print(0)
else:
	print(len(b))


str1 = input()
str2 = str1[1:-1]
list1 = str2.split(', ')
list2 = list()
if str2 == '':
	print(0)
else:
	for i in list1:
		if i not in list2:
			list2.append(i)
	print(len(list2))


from string import ascii_lowercase
letters = str(input())
answer = 0
for c in ascii_lowercase:
	if c in letters:
		answer += 1
print(answer)


import math
import os
import random
import re
import sys
a = str(input())
a = a.replace('{', '')
a = a.replace('}', '')
a = a.replace(',', '')
a = a.replace(' ', '')
b = ''
for i in a:
	if i not in b:
		b = b + i
print(len(b))


a = input()
l = []
if len(a) == 2:
	print(0)
elif len(a) == 3:
	print(1)
else:
	for i in range(1, len(a), 3):
		l.append(a[i])
	print(len(set(l)))


d = input()[1:-1].split(', ')
d1 = {}
if d[0] == '':
	print(0)
else:
	for i in d:
		if i in d1:
			d1[i] += 1
		else:
			d1[i] = 1
	print(len(d1))


i = input()
if i == '{}':
	print(0)
else:
	k = 1
	o = []
	while k < len(i):
		o.append(i[k])
		k += 3
	print(len(list(set(o))))


s = input()
s = s.replace('{', ' ')
s = s.replace('}', ' ')
s = s.replace(',', ' ')
str = set(s)
print(len(str) - 1)


def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True
from sys import stdin, stdout
import math, queue, heapq
fastinput = stdin.readline
fastout = stdout.write
t = 1
while t:
	t -= 1
	s = set(list(fastinput()))
	s.discard('{')
	s.discard('}')
	s.discard(',')
	s.discard(' ')
	s.discard('\n')
	print(len(s))


def main():
	from re import sub
	s = sub('[{},\\s]', '', input())
	counts = {}
	for c in s:
		counts[c] = True
	print(len(counts))
main()


a = set(input())
str = ''
for ch in a:
	if ord(ch) >= ord('a') and ord(ch) <= ord('z'):
		str += ch
print(len(str))


a = input()
a = a.replace(' ', '')
l = []
if a[1] == '}':
	print('0')
else:
	for i in range(len(a)):
		if i % 2 != 0:
			l.append(a[i])
	print(len(set(l)))


x = list(input())
a = []
for char in x:
	if char == '{' or char == ',' or char == ' ' or (char == '}'):
		continue
	else:
		a.append(char)
print(len(set(a)))


X = input()
t = X[1:len(X) - 1].split(', ')
print(len(set(t)) if len(X) != 2 else 0)


a = input()
a = a.replace('{', '')
a = a.replace('}', '')
a = [i for i in a.split(', ') if len(i) == 1]
print(len(set(a)))


s = input()[1:-1].split(', ')
print(len(set(s)) - ('' in s))


s = set(input())
c = len(s) - 2
if ',' in s:
	print(c - 2)
else:
	print(len(s) - 2)


s = input()
l = []
for i in range(len(s)):
	if s[i] >= 'a' and s[i] <= 'z':
		l.append(s[i])
print(len(list(set(l))))


s = str(list(input()))
s = s.replace('{', '')
s = s.replace('}', '')
s = s.replace(',', '')
s = s.replace(' ', '')
s = set(s)
r = ''
for i in s:
	if i != '[' and i != "'" and (i != ']'):
		r += i
print(len(r))


emon = input()
mishu = []
for i in emon:
	if i >= 'a' and i <= 'z':
		mishu.append(i)
l = []
emon1 = []
for i in mishu:
	if i not in l:
		emon1.append(i)
		l.append(i)
print(len(emon1))


x = input()
a = set()
for i in x:
	if i.isalnum():
		a.add(i)
print(len(list(a)))


arr = input()
s = {ord(ch) for ch in arr if ord(ch) >= 97 and ord(ch) <= 122}
print(len(s))


s = input()
s = s[1:len(s) - 1]
l = s.split(', ')
set1 = set(l)
if s == '':
	print(0)
else:
	print(len(set1))


a = input()
a1 = a.replace('{', '')
a2 = a1.replace('}', '')
a3 = a2.replace(', ', '')
b = []
for x in a3:
	b.append(x)
b = list(set(b))
c = ''.join(b)
print(len(c))


a = input()
b = ''
for i in range(len(a)):
	if 'a' <= a[i] <= 'z':
		b += a[i]
b = set(b)
print(len(b))


s = set(input())
z = []
for i in s:
	if i.isalpha() and i not in z:
		z.append(i)
print(len(z))


arr = []
s = input()
s = list(s)
if len(s) <= 2:
	print('0')
else:
	for i in range(1, len(s), 3):
		arr.append(s[i])
	print(len(list(set(arr))))


import sys
a = list(input())
if len(a) == 2:
	print('0')
	sys.exit()
b = a
k = 0
for i in a:
	if i == ' ' or i == '{' or i == '}' or (i == ','):
		b.remove(i)
c = set(b)
for i in c:
	if i == ' ':
		k = k + 1
print(len(c) - k)


string = input()
if len(string) == 2:
	print(0)
elif len(string) == 3:
	print(1)
else:
	letters = string[1:-1].split(', ')
	print(len(set(letters)))


s = str(input())
s = s[1:-1]
s = s.replace(', ', '')
k = 0
count = 0
t = ''
while count != len(s):
	if s[k] not in s[:k]:
		t = t + s[k]
		count += s.count(s[k])
	k += 1
print(len(t))


s = input()
s1 = 'abcdefghijklmnopqrstuvwxyz'
s2 = set()
for i in s:
	if i in s1:
		s2.add(i)
print(len(s2))


line = input()
a = line[1:-1]
p = a.split(', ')
l = len(p)
i = 0
s = set()
if len(a) == 0:
	ans = 0
else:
	while i < l:
		s.add(p[i])
		i += 1
	ans = len(s)
print(ans)


s = input()
letters = set(s[1:-1].split(', '))
if '' in letters:
	letters.remove('')
print(len(letters))


t = ''.join(set(input()))
z = 0
for i in range(len(t)):
	if ord(t[i]) >= 97 and ord(t[i]) <= 122:
		z += 1
print(z)


s = list(input())
l = [i for i in s if ord(i) in range(97, 123)]
l = list(set(l))
print(len(l))


S = input()
sets = S[1:len(S) - 1].split(', ')
alphabets = []
for i in range(0, 26):
	alphabets.append(False)
for i in range(0, len(sets)):
	if sets[0] != '':
		alphabets[ord(sets[i]) - 97] = True
cnt = 0
for i in range(0, 26):
	if alphabets[i]:
		cnt += 1
print(cnt)


z = list(input())
b = ['{', '}', ',', ' ']
count = 0
for i in z:
	if i in b:
		pass
	else:
		count += 1
		b.append(i)
print(count)


str = input()
sum = 0
str1 = str.strip('{')
str2 = str1.strip('}')
str3 = str2.split(', ')
for x in ['q', 'w', 'r', 'e', 't', 'y', 'u', 'i', 'o', 'p', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm']:
	if x in str3:
		sum += 1
print(sum)


n = input()
if len(n) == 2:
	print(0)
else:
	nn = n[1:-1]
	l = nn.split(', ')
	d = dict()
	for i in range(len(l)):
		if l[i] in d:
			d[l[i]] = d[l[i]] + 1
		else:
			d[l[i]] = 0
	print(len(d))


a = input()
c = ''
for i in range(1, len(a) - 1):
	c += a[i]
if a == '{}':
	print(0)
else:
	print(len(set(c.split(', '))))


l1 = input()[1:-1].split(', ')
l2 = []
u = 0
for c in l1:
	if not c:
		break
	if not c in l2:
		u += 1
		l2.append(c)
print(u)


a = input('')
t = len(a)
x = 0
b = []
for i in range(t // 3):
	if not a[3 * i + 1] in b:
		b.append(a[3 * i + 1])
		x += 1
print(x)


c = input()
c = c.replace('{', '')
c = c.replace('}', '')
c = c.replace(', ', '')
i = 0
k = 0
while i < len(c):
	a = 0
	j = 0
	while j < i:
		if c[j] == c[i]:
			a = 1
			break
		else:
			j += 1
	if a == 0:
		k += 1
	i += 1
print(k)


antons_letter = input()
print(len(set(antons_letter[1:len(antons_letter) - 1:3])))


arr = list(input().split())
arr[0] = arr[0][1:]
arr[-1] = arr[-1].replace('}', ',')
chara = set(arr)
length = 0
if list(chara)[0] == ',':
	print('0')
else:
	print(len(chara))


s = input()
k = list(s)
length = len(s)
list1 = [0] * 26
list2 = [0] * 26
for i in range(length):
	p = ord(k[i])
	if p >= 65 and p <= 90:
		list1[p - 65] = 1
	elif p >= 97 and p <= 122:
		list2[p - 97] = 1
sm = 0
for i in range(26):
	sm += list1[i]
	sm += list2[i]
print(sm)


final = 0
import math
n = list(input())
l = len(n)
if l < 3:
	print('0')
else:
	f = str()
	fff = str()
	for i in range(int(l / 3)):
		f += n[3 * i + 1]
	ff = list(f)
	lm = len(ff)
	for i in range(26):
		n = f.find(chr(i + 97))
		if n >= 0:
			final += 1
		else:
			final += 0
	print(final)


inp = input()
let = inp[1:]
paran = let.find('}')
data = let[:paran]
lst = list()
if inp == '{}':
	print('0')
else:
	for i in data.split(', '):
		if i not in lst:
			lst.append(i)
	l = len(lst)
	print(l)


s = input()
s1 = set()
for i in s:
	if i.isalpha():
		s1.add(i)
print(len(s1))


s = input()
s1 = set()
for c in s:
	if ord(c) >= 97 and ord(c) <= 122:
		s1.add(c)
print(len(s1))


str1 = input()
str1 = str1[1:-1]
count = 0
list1 = []
for i in range(len(str1)):
	if str1[i] != ',' and str1[i] != ' ' and (str1[i] not in list1):
		list1.append(str1[i])
		count += 1
print(count)


letters = set(input())
n_distincts = len(letters) - 2
if ',' in letters:
	n_distincts -= 2
print(n_distincts)


a = input()
b = set()
import string
tar = string.ascii_lowercase
for i in a:
	if i in tar:
		b.add(i)
print(len(b))


def distinct_letters_number(word):
	distinct_letters = set()
	for letter in word:
		if letter not in ('{', ' ', ',', '}'):
			distinct_letters.add(letter)
	return len(distinct_letters)
print(distinct_letters_number(input()))


l = list(map(str, input()))
s = set(l)
ans = len(s) - 2
if ',' in s:
	ans -= 1
if ' ' in s:
	ans -= 1
print(ans)


s = str(input())
s = s.replace(',', '')
s = s.replace('{', '')
s = s.replace('}', '')
s = s.replace(' ', '')
s = sorted(s)
s = list(dict.fromkeys(s))
print(len(s))


n = input()
n = n.replace(',', '')
n = n[1:-1]
print(len(set(n.split())))


def main():
	i = input()
	i = i[1:len(i) - 1]
	i = i.split(',')
	s = set()
	for e in i:
		if e != '':
			s.add(e.strip())
	return len(s)
print(main())


char = list(input())
if len(char) == 2:
	print(0)
else:
	del char[0]
	L = len(char)
	del char[L - 1]
	string = ''.join(char)
	letter = string.split(', ')
	englet = ''.join(letter)
	l = len(englet)
	N = 1
	for i in range(1, l):
		if englet.find(letter[i], 0, i) == -1:
			N += 1
	print(N)


s = input().replace('{', '').replace('}', '').replace(', ', '')
t = []
if len(s) == 0:
	print(0)
else:
	t.append(s[0])
	count = 1
	for i in s:
		flag = 0
		for j in t:
			if i == j:
				flag = 1
				break
		if flag == 0:
			count = count + 1
			t.append(i)
	print(count)


my_list = input()[1:-1]
if len(my_list) == 0:
	print(0)
else:
	print(len(set(my_list.split(', '))))


def find_it(b):
	lists = [i.strip() for i in b[1:-1].split(',')]
	dict = {}
	for i in lists:
		if i:
			if not i in dict:
				dict[i] = 1
			else:
				dict[i] += 1
	return len(dict)
b = input()
print(find_it(b))


l = input()
li = list(l)
li.sort()
s = 0
for i in range(len(li) - 1):
	if not li[i] == li[i + 1]:
		s = s + 1
if len(li) <= 3:
	s = s + 2
print(s - 3)


def is_char_in(k, c):
	for kk in k:
		if kk == c:
			return True
	return False
s = str(input())
s = s[1:-1]
s = s.split(',')
s = [str(ss).strip() for ss in s]
l = []
for ss in s:
	if not is_char_in(l, ss) and ss != '':
		l.append(ss)
print(len(l))


fhand = input()
lst = fhand.split(', ')
if len(fhand) == 2:
	print(0)
elif len(fhand) == 3:
	print(1)
else:
	lst[0] = lst[0][1]
	lst[-1] = lst[-1][0]
	print(len(set(lst)))


from collections import Counter
letters = input()
count = 0
trim = letters[1:len(letters) - 1]
trim = trim.replace(',', '')
trim = trim.split()
print(len(Counter(trim).keys()))


array = input().split(', ')
array[0] = array[0][1:]
array[len(array) - 1] = array[len(array) - 1][:1]

def distinct(seq, idfun=None):
	if idfun is None:

		def idfun(x):
			return x
	seen = {}
	result = []
	for item in seq:
		marker = idfun(item)
		if marker in seen:
			continue
		seen[marker] = 1
		result.append(item)
	return result
if array[0] in '}':
	print(0)
else:
	print(len(distinct(array)))


xx = input()
x = list(xx)
l = []
for i in x:
	if i not in l and i != '{' and (i != ',') and (i != '}') and (i != ' '):
		l.append(i)
print(len(l))


import sys
n = input()
if len(n) < 3:
	print(0)
else:
	temp = n[1:len(n) - 1].split(', ')
	temp = set(temp)
	print(len(temp))


letters = input().strip('{')
letters = letters.strip('}')
if letters == '':
	num = 0
else:
	letters = letters.split(', ')
	from collections import Counter
	result = Counter(letters)
	num = len(result)
print(num)


s = input()
ans = list(''.join((e for e in s if e.isalnum())))
print(len(set(ans)))


s = input()
letters = [x for x in s if x.isalpha()]
print(len(set(letters)))


n = str(input())
if n == '{}':
	print(0)
else:
	print(len(set(n[1:len(n) - 1].split(', '))))


f = input()
f = list(f[1:-1])
if len(f) > 0:
	f.sort()
	f.reverse()
	if ',' in f:
		f = f[:f.index(',')]
	count = 0
	distinct = 0
	while count < len(f):
		count += f.count(f[count])
		distinct += 1
	print(distinct)
else:
	print(0)


def slove():
	set_str = input()
	clean_str = set_str[1:-1]
	letter = clean_str.split(', ')
	if clean_str != '':
		print(len(set(letter)))
	else:
		print('0')
slove()


a = input()[1:-1].split(',')
a = [aa.strip() for aa in a if len(aa) > 0]
print(len(set(a)))


cnt = 1
for i in range(ord('a'), ord('z') + 1):
	exec(str(chr(i)) + ' = ' + str(cnt))
	cnt += 1
inp = eval(input())
print(len(inp))


s = input()
length = len(s)
i = 1
ls = []
count = 0
while i < length - 1:
	if s[i] not in ls:
		count += 1
		ls.append(s[i])
	i = i + 3
print(count)


x = input()
m = []
for i in x:
	if i == '{' or i == '}' or i == ',' or (i == ' '):
		continue
	else:
		m.append(i)
print(len(set(m)))


st = input()
new_st = [item for item in st if item.isalpha()]
print(len(set(new_st)))


a = input()
s = set()
for i in range(len(a)):
	if i == 0 or i == len(a) - 1 or a[i] == ' ' or (a[i] == ','):
		continue
	else:
		s.add(a[i])
print(len(s))


from sys import stdin
_input = stdin.readline
(_str, _set, _len, _int) = (str, set, len, int)

def solution():
	print(_len(_set([i for i in _input().replace(',', '').rstrip('}\n').lstrip('{').split()])))
solution()


word = set(input().replace('{', '').replace('}', '').replace(' ', '').split(','))
if word != {''}:
	words = set()
	while word:
		last = set()
		last.add(word.pop())
		if not last.issubset(words):
			words.add(str(last))
	print(len(words))
else:
	print(0)


set_in = list({x for x in input().strip('{}').split(', ')})
print(0 if set_in[0] is '' else len(set_in))


s = str(input())
for i in range(0, len(s)):
	if s[i] == '{':
		st = []
	elif s[i].isalpha():
		st.append(s[i])
print(len(set(st)))


kek = set(input().split('{')[1].split('}')[0].split(', '))
if len(kek) == 1:
	if '' in kek:
		print(0)
	else:
		print(1)
else:
	print(len(kek))


import sys
import math

def sinp():
	return sys.stdin.readline().strip()

def iinp():
	return int(input())

def ninp():
	return map(int, sys.stdin.readline().strip().split())

def linp():
	return list(map(int, sys.stdin.readline().strip().split()))
a = sinp()
frq = [0] * 26
cnt = 0
for c in a:
	if c.isspace() or c == '{' or c == '}' or (c == ','):
		pass
	else:
		frq[ord(c) - 97] += 1
for c in frq:
	if c != 0:
		cnt += 1
print(cnt)


a = input()
a_list = []
for i in a:
	if i != '{' and i != ',' and (i != ' ') and (i != '}'):
		a_list.append(i)
print(len(set(a_list)))


word = input()
c = len(set(word) - set(' ,{}'))
print(c)


s = input()
l = []
c = 0
for i in range(0, len(s)):
	if s[i] >= 'a' and s[i] <= 'z':
		l.append(s[i])
for i in range(0, len(list(set(l)))):
	c = c + 1
print(c)


a = list(input())
z = []
s = 0
a.remove(a[0])
a.pop()
for i in a:
	if i == ',':
		a.remove(',')
for i in a:
	if i == ' ':
		a.remove(' ')
for i in a:
	if i not in z:
		z.append(i)
for i in z:
	s = s + 1
print(s)


i = input()
print(len(set(i[1:-1].split(', '))) * (2 < len(i)))


n = list(input())
del n[0]
del n[-1]
distinct_factors = list(set(n))
if len(distinct_factors) == 0:
	number_of_letters = 0
elif len(distinct_factors) == 1:
	number_of_letters = 1
elif len(distinct_factors) >= 2:
	number_of_letters = len(distinct_factors) - 2
print(number_of_letters)


sa = input()
if sa == '{}':
	print(0)
else:
	sa2 = []
	for x in range(1, len(sa), 3):
		sa2.append(sa[x])
	sa3 = list(set(sa2))
	print(len(sa3))


def fun(a):
	a = a.replace(',', '')
	a = a.replace(' ', '')
	a = a.strip('{')
	a = a.strip('}')
	print(len(set(a)))
a = input()
fun(a)


tem_data = input()
data = []
for m in tem_data:
	if m != ' ' and m != '{' and (m != '}') and (m != ','):
		data.append(m)
data = set(data)
print(len(data))


n = input()
A = []
for i in range(0, 26):
	A.append(0)
for i in range(0, len(n)):
	d = ord(n[i])
	d = d - 97
	if d >= 0 and d <= 25:
		A[d] = A[d] + 1
	c = 0
for i in range(0, 26):
	if A[i] > 0:
		c = c + 1
print(c)


n = input()
arr = []
for i in n:
	if i not in '{}, ':
		arr.append(i)
sarr = set(arr)
print(len(sarr))


a = input()
import re
c = re.findall('[a-z]', a)
d = set(c)
print(len(d))


s = input()
string = ''
for i in s:
	if i == '{' or i == '}' or i == ',' or (i == ' '):
		continue
	else:
		string = string + i
new_s = ''.join(set(string))
print(len(new_s))


a = input()
a = a.replace('{', '')
a = a.replace('}', '')
a = a.split(', ')
b = []
for i in range(len(a)):
	if a[i] not in b and a[i] != '':
		b.append(a[i])
print(len(b))


lts = input()
a = set()
for i in lts:
	if 'a' <= i <= 'z':
		a.add(i)
print(len(a))


import string
word = input()
cntr = 0
l = []
for i in word:
	if i in string.ascii_letters and i not in l:
		cntr += 1
		l.append(i)
print(cntr)


letters = []
letters.append(input())
alphabets = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
new_letters = []
for i in letters[0]:
	if i in alphabets:
		new_letters.append(i)
	else:
		continue
if len(new_letters) != 0:
	distinct_letters = []
	distinct_letters.append(new_letters[0])
	for j in new_letters:
		if j not in distinct_letters:
			distinct_letters.append(j)
		else:
			continue
	print(len(distinct_letters))
else:
	print(0)


st = input()
st1 = st[1:len(st) - 1]
if st1 == '':
	print('0')
else:
	a = [i for i in st1.split(', ')]
	myset = set(a)
	print(len(myset))


s = input()
l = ''
for i in s:
	if i == ' ' or i == ',' or i == '{' or (i == '}'):
		continue
	else:
		l += i
ans = len(set(list(l)))
print(ans)


s = input()
s = sorted(s)
s = list(filter(lambda x: x >= 'a' and x <= 'z', s))
if len(s) == 0:
	print('0')
else:
	x = 1
	for i in range(0, len(s) - 1):
		if s[i] == s[i + 1]:
			continue
		else:
			x += 1
	print(x)


s = input()
L = []
for i in range(26):
	L.append(0)
Len = len(s)
for i in range(Len):
	if s[i] >= 'a' and s[i] <= 'z':
		L[ord(s[i]) - ord('a')] = 1
num = 0
for i in range(26):
	if L[i]:
		num += 1
print(num)


alphabets = input()
if alphabets == '{}':
	print('0')
else:
	alphabets = alphabets[1:-1].split(', ')
	alphabets.sort()
	count = 0
	i = 0
	for i in range(len(alphabets) - 1):
		if alphabets[i] == alphabets[i + 1]:
			count += 1
	print(len(alphabets) - count)


n = input()
w = n.translate({ord(i): None for i in ', {}'})
a = []
for i in range(len(w)):
	a.append(w[i])
s = set(a)
print(len(s))


s = input()
res = []
for i in range(len(s)):
	if s[i].isalpha() and s[i] not in res:
		res.append(s[i])
print(len(res))


set = str(input())
set = set.replace(' ', '')
set = list(set.replace(',', ''))
count = 0
letter = []
for i in set[1:len(set) - 1]:
	if i not in letter:
		letter.append(i)
print(len(letter))


s = list(input())
s.remove('{')
s.remove('}')
s = ''.join(s).split(' ')
if s == ['']:
	print(0)
else:
	l = len(set(''.join(s).split(',')))
	print(l)


n = input().split(', ')
n[0] = n[0].replace('{', '')
n[-1] = n[-1].replace('}', '')
n = list(set(n))
for i in range(len(n)):
	if n[i] == ' ' or n[i] == '':
		n.remove(n[i])
print(len(n))


s = input()
s = s[1:len(s) - 1:1]
ans = 0
y = []
x = s.split()
for i in x:
	y.append(i[0])
print(len(set(y)))


i = input()
i2 = i[1:-1]
l = i2.split(', ')
s = set(l)
if l == ['']:
	s = set()
re = len(s)
print(re)


s = input()
l = list(s)
new = []
for i in l:
	if i != '{' and i != '}' and (i != ',') and (i != ' '):
		new.append(i)
sub = set(new)
print(len(sub))


s = input()
alpha = []
temp = ''
cnt = 0
for ch in s:
	if ch.isalpha() == True:
		if ch not in temp:
			cnt += 1
			temp = temp + ch
print(cnt)


def main():
	set_items = [item for item in list(input()) if item != '{' and item != '}' and (item != ',') and (item != ' ')]
	print(len(set(set_items)))
main()


s = {i for i in input() if i.isalpha()}
print(len(s))


s = input()
i = 0
a = set()
while i < len(s) and s[i] != '}':
	if s[i] != ',' and s[i] != ' ' and (s[i] != '{'):
		a.add(s[i])
	i += 1
print(len(a))


s = input()
mydict = {}
for i in s:
	if i >= 'a' and i <= 'z':
		mydict[i] = 1
print(len(mydict))


ans = set()
for c in input():
	if c in 'abcdefghijklmnopqrstuvwxyz':
		ans.add(c)
print(len(ans))


s = input()
s = set(s)
m = len(s) - 2
if ' ' in s:
	m -= 1
if ',' in s:
	m -= 1
print(m)


n = input()
n = n[1:len(n) - 1]
li = []
for i in n:
	if i != ',' and i != ' ':
		li.append(i)
s = set(li)
print(len(s))


letters = [a for a in input()[1:-1].strip().split(', ')]
if len(letters) == 1 and letters[0] == '':
	print(0)
else:
	print(len(set(letters)))


n = input()
c = 0
a = []
for v in n:
	if v.isalnum():
		a.append(v)
a = set(a)
print(len(a))


a = input()
if len(a) == 3:
	print(1)
	exit()
if len(a) == 2:
	print(0)
	exit()
b = [i.strip() for i in a[1:len(a) - 1].split(',')]
print(len(set(b)))


from math import *

def main():
	s = input()
	if s == '{}':
		print(0)
		exit()
	s = s.replace('{', '').replace('}', '').split(', ')
	al = []
	ans = 0
	for c in s:
		if c not in al:
			ans += 1
			al.append(c)
	print(ans)
main()


__author__ = 'Utena'
n = input()
m = []
for a in n:
	if a != '{' and a != '}' and (a != ' ') and (a != ','):
		m.append(a)
print(len(set(m)))


s = input()
arr = set()
for x in s:
	if x not in ['}', '{', ',', ' ']:
		arr.add(x)
print(len(arr))


a = input()
a = a.replace(' ', '')
a = a.replace(',', '')
a = a[1:-1]
la = len(a)
a = ''.join(sorted(a))
b = '...'
j = 0
for i in a:
	if i not in b:
		b = b + i
		j = j + 1
print(j)


x = list(input())
y = []
for i in x:
	if i >= 'a' and i <= 'z':
		y.append(i)
print(len(set(''.join(y))))


ins = input()[1:-1]
if not ins:
	print(0)
else:
	print(len(set((x.strip() for x in ins.split(',')))))


list_1 = list(map(chr, range(ord('a'), ord('z') + 1)))
word = list(input())
sum = 0
for i in list_1:
	if i in word:
		sum = sum + 1
print(sum)


l = set(str(input()))
s = list(l)
s.sort()
li = s.copy()
for i in s:
	if i == ' ' or i == ',' or i == '{' or (i == '}'):
		li.remove(i)
print(len(li))


inp = set(input()[1:-1].split(', '))
if list(inp)[0] == '':
	print(0)
else:
	print(len(inp))


import math
from collections import *
import sys
from functools import reduce

def get_ints():
	return map(int, input().strip().split())

def get_list():
	return list(get_ints())

def get_string():
	return list(input().strip().split())

def printxsp(*args):
	return print(*args, end='')

def printsp(*args):
	return print(*args, end=' ')
UGLYMOD = int(1000000000.0) + 7
SEXYMOD = 998244353
MAXN = int(100000.0)
s = set(list(input().strip('{}').split(', ')))
s.discard('')
print(len(s))


a = set(input())
if ',' in a and ' ' in a:
	print(len(a) - 4)
elif ',' in a or ' ' in a:
	print(len(a) - 3)
else:
	print(len(a) - 2)


set1 = input()
if len(set1) == 2:
	print('0')
elif len(set1) == 3:
	print('1')
else:
	set2 = set1[1:-1]
	bulk = set2.split(', ')
	a = set(bulk)
	print(len(a))


text = input()
idf = 0
if text == '{}':
	print(0)
	idf = 1
text = text[1:-1]
lis = text.split(', ')
lib = dict()
for item in lis:
	if item not in lib:
		lib[item] = 1
count = 0
for char in lib:
	count += 1
if idf == 0:
	print(count)


import re

def main():
	letters = input()
	if len(letters) <= 1000:
		arr = re.findall('\\w+', letters)
		tempArr = []
		for letter in arr:
			if not letter in tempArr:
				tempArr.append(letter)
		print(len(tempArr))
main()


s = input()
alpha = []
for i in range(1, len(s) - 1):
	if s[i] != ',' and s[i] != ' ':
		if s[i] not in alpha:
			alpha.append(s[i])
print(len(alpha))


import sys

def input():
	return sys.stdin.readline().strip()

def iinput():
	return int(input())

def rinput():
	return map(int, sys.stdin.readline().strip().split())

def get_list():
	return list(map(int, sys.stdin.readline().strip().split()))
n = list(input())
s = list(set(n))
if len(s) == 2:
	print(0)
elif len(s) == 3:
	print(1)
else:
	print(len(s) - 4)


s = set(sorted(list(input())))
s.discard('{')
s.discard('}')
s.discard(',')
s.discard(' ')
print(len(s))


import math
import cmath
from decimal import *
from fractions import *
a = input()
b = list()
res = 0
for _ in a:
	if 'a' <= _ <= 'z' and b.count(_) == 0:
		b.append(_)
		res += 1
print(res)


s = input()
s1 = len(s)
i = 1
l = []
while s1 > 2 and i < s1:
	l.append(s[i])
	if s[i + 1] == ',':
		i += 3
	else:
		break
s1 = len(l)
for i in range(s1 - 1):
	for j in range(i + 1, s1):
		if l[i] == l[j]:
			l[j] = 0
k = 0
for i in range(s1):
	if l[i] != 0:
		k += 1
print(k)


a = input()
i = 1
k = 0
c = dict()
while i < len(a) and a[1] != '}':
	c[a[i]] = 1
	i += 3
for i in c.keys():
	k += 1
print(k)


s = input()
our = []
for i in s:
	if i.isalpha():
		if not i in our:
			our.append(i)
print(len(our))


s = input('')
string = s[1:-1]
se = set(string)
if s == '{}':
	print(0)
else:
	if ' ' in string:
		se.remove(' ')
	if ',' in string:
		se.remove(',')
	print(len(se))


line = input()
s = ''
l = len(line)
N = 0
i = 1
while i < l - 1:
	if line[i] not in s:
		N += 1
		s += line[i]
	i += 3
print(N)


s = input()
l = []
for i in range(26):
	l.append(0)
for i in range(len(s)):
	if s[i] >= 'a' and s[i] <= 'z':
		l[ord(s[i]) - 97] = 1
nr = 0
for i in range(26):
	if l[i] == 1:
		nr += 1
print(nr)


st = input()
list2 = []
for i in range(len(st)):
	if i % 3 == 1:
		list2.append(ord(st[i]))
list2 = sorted(list2)
n = len(list2)
for i in range(len(list2) - 2):
	if list2[i] == list2[i + 1]:
		n = n - 1
if list2[len(list2) - 1] == list2[len(list2) - 2]:
	n = n - 1
if len(st) == 3:
	n = 1
print(n)


s = input()
s = s.replace('{', '')
s = s.replace(',', '')
s = s.replace('}', '')
s = s.replace(' ', '')
s = [l for l in s]
length = len(set(s))
print(length)


try:
	n = input()
	l = []
	i = 1
	if len(n) > 2:
		while i < len(n):
			l.append(n[i])
			i += 3
		print(len(set(l)))
	else:
		print(0)
except:
	pass


str = input()
l = []
for i in str:
	if i not in l and 'a' <= i <= 'z':
		l.append(i)
	else:
		pass
print(len(l))


def Anton_and_Letters(s):
	s = s.replace(', ', '')
	s = sorted(s)
	del s[-1]
	del s[-1]
	if len(s) == 0:
		return 0
	else:
		c = 1
		for i in range(0, len(s) - 1):
			if s[i] != s[i + 1]:
				c += 1
		return c
s = input()
print(Anton_and_Letters(s))


from collections import Counter
s = ''
s = input()
li = []
for i in range(0, len(s)):
	if s[i].isalpha():
		li.append(s[i])
l = Counter(li).most_common()
print(len(l))


n = input()
if n == '{}':
	print(0)
else:
	lst = n[1:-1]
	lst = set(lst.split(', '))
	print(len(lst))


x = input()
res = set()
for i in x:
	if i >= 'a' and i <= 'z':
		res.add(i)
print(len(res))


text = input()
a = []
for i in range(1, len(text) - 1, 3):
	if text[i] not in a:
		a.append(text[i])
print(len(a))


w = input()
unique_words = set(w)
unique_word_count = len(unique_words)
if unique_word_count == 2:
	print(0)
elif unique_word_count == 3:
	print(1)
else:
	print(unique_word_count - 4)


n = input()
k = 0
n = {x for x in n}
k = len(n) - 4
if len(n) == 2:
	k = 0
if len(n) == 3:
	k = 1
print(k)


m = {input()}
m = list(m)
a = []
for i in m[0]:
	if i.isalpha():
		a.append(i)
print(len(set(a)))


b = [b for b in input()]
n = len(b)
b = b[1::3]
count = 0
n = len(b)
for i in range(len(b)):
	j = i + 1
	while j < len(b):
		if b[i] == b[j]:
			del b[j]
			b.insert(j, 7)
		j = j + 1
for i in b:
	if i != 7 and i != '}' and (i != ','):
		count = count + 1
print(count)


n = input().split()
if n != ['{}']:
	new_list = []
	for i in n:
		i = i.replace('{', '')
		i = i.replace(',', '')
		i = i.replace('}', '')
		new_list.append(i)
	print(len(set(new_list)))
else:
	print(0)


import re
s = str(input())
print(len(set(re.findall('[a-z]+', s))))


n = input()
lst = []
for x in n:
	if x.isalpha():
		lst.append(x)
lst = set(lst)
print(len(lst))


line = input()
exc = ['{', '}', ',', ' ']
set = set((x for x in line if x not in exc))
print(len(set))


s = input()
a = set()
for i in range(1, len(s) - 1):
	a.add(s[i:i + 1])
n = len(a)
if ' ' in a:
	n = n - 1
if ',' in a:
	n = n - 1
print(n)


x = input()
(i, t) = (1, 0)
l = []
c = 0
found = False
while i <= len(x) - 1:
	while t <= len(l) - 1 and found == False:
		if x[i] == l[t]:
			found = True
		t += 1
	if found == False:
		c += 1
	l = l + [x[i]]
	i += 3
	t = 0
	found = False
if x == '{}':
	c = 0
print(c)


import re
inp = input()
x = re.findall('[a-z]', inp)
letter = dict()
for i in x:
	letter[i] = letter.get(i, 0) + 1
x = print(len(letter.values()))


x = input()
z = [0] * 256
if len(x) > 2:
	for i in range(1, len(x) + 1, 3):
		z[ord(x[i])] = 1
print(z.count(1))


n = list(input().split(', '))
if len(n) == 1 and len(list(n[0])) == 2:
	print(0)
elif len(n) == 1 and len(list(n[0])) == 3:
	print(1)
else:
	b = list(n.pop(0))
	e = list(n.pop(-1))
	b.pop(0)
	e.pop(1)
	a = b + n + e
	print(len(set(a)))


s = input()
s = s.replace(' ', '')
n = len(s)
vis = []
for i in range(1, n - 1, 2):
	if s[i] not in vis:
		vis.append(s[i])
ans = len(vis)
print(ans)


a = []
for i in str(input()):
	a.append(i)
if len(set(a)) == 3:
	print(len(set(a)) - 2)
elif len(set(a)) > 3:
	print(len(set(a)) - 4)
else:
	print('0')


x = input()
list = x.split()
list2 = []
if list[0][1] == '}':
	list2 = []
else:
	list2.append(list[0][1])
i = 1
while i < len(list):
	list2.append(list[i][0])
	i += 1
list3 = []
for item2 in list2:
	if item2 not in list3:
		list3.append(item2)
print(len(list3))


string = str(input())
string = string[1:len(string) - 1]
string = string[::3]
set = {i for i in string}
print(len(set))


from sys import stdin
n = stdin.readline().strip().replace('{', '').replace('}', '').split(', ')

def solution(n):
	s = set()
	for x in n:
		if x == '':
			return 0
		s.add(x)
	return len(s)
print(solution(n))


test = list(input())
another = test[1:-1]
final = ''.join(another)
take = final.replace(', ', '')
result = len(set(take))
print(result)


s = input()
s = s.replace(',', '')
s = s.replace('{', '')
s = s.replace('}', '')
s = s.replace(' ', '')
a = ''
for i in s:
	if i not in a:
		a = a + i
print(len(a))


from sys import stdin, stdout, stderr, setrecursionlimit
import inspect, re
setrecursionlimit(100000)

def debug(*e):
	if not __debug__:
		print(*e, file=stderr)

def dd(*vals):
	frame = inspect.getframeinfo(inspect.stack()[1][0])
	vs = re.search('dd\\((.+)\\)', frame.code_context[0]).group(1).split(',')
	if vs:
		debug(','.join(('{0} = {1}'.format(vs[i], v) for (i, v) in enumerate(vals))))

def trace(f):

	def traced(*args, **kw):
		debug('calling {} with args {}, {}'.format(f.__name__, args, kw))
		return f(*args, **kw)
	return traced

def read():
	return stdin.readline().rstrip()

def readarr(sep=None, maxsplit=-1):
	return read().split(sep, maxsplit)

def readint():
	return int(read())

def readintarr(sep=None, maxsplit=-1):
	return [int(a) for a in readarr(sep, maxsplit)]

def write(*args, **kwargs):
	sep = kwargs.get('sep', ' ')
	end = kwargs.get('end', '\n')
	stdout.write(sep.join((str(a) for a in args)) + end)

def writearr(arr, sep=' ', end='\n'):
	stdout.write(sep.join((str(a) for a in arr)) + end)
letters = read()[1:-1].split(',')
s = {e.strip() for e in letters if e}
debug(s)
write(len(s))


def antonAndLetters():
	value = set(input())
	count = 0
	for i in value:
		if i.isalpha():
			count += 1
	print(count)
antonAndLetters()


s = input()
if len(s) == 2:
	print(0)
	exit()
print(len(set(s[1::3])))


a = input()
b = a.replace('{', ' ').replace('}', '').split(',')
if b == [' ']:
	print('0')
else:
	n = len(b)
	list = set(b)
	print(len(list))


s = input()
a = []
for i in range(len(s)):
	if s[i] not in a:
		if s[i] == '{' or s[i] == '}' or s[i] == ' ' or (s[i] == ','):
			continue
		else:
			a += s[i]
print(len(a))


n = input()
if len(n) == 2:
	print(0)
else:
	x = n[1:-1].split(', ')
	xx = set(x)
	print(len(xx))


s = str(input())
seen = set()
for i in s:
	if i.isalpha():
		if i not in seen:
			seen.add(i)
print(len(seen))


x = input().lstrip('{').rstrip('}').replace(' ', '')
y = set(list(x.split(',')))
if x == '':
	y = set()
print(len(y))


entrada = input()
if entrada == '{}':
	print(0)
	exit()
entrada = entrada[1:len(entrada) - 1].split(', ')
arr_a = [0] * 127
result = 0
i = 0
while i < len(entrada):
	arr_a[ord(entrada[i])] = 1
	i += 1
i = 0
while i < 127:
	result += arr_a[i]
	i += 1
print(result)


sets = input()
sets = sets.replace(' ', '').replace('{', '').replace('}', '').replace(',', '')
print(len(set(sets)))


a = list(input())
b = set()
for i in a:
	if i == '{':
		a.remove(i)
	elif i == '}':
		a.remove(i)
	elif i == ',':
		a.remove(i)
for i in a:
	if i == ' ':
		a.remove(i)
	elif i == '}':
		a.remove(i)
b.update(a)
print(len(b))


letters = input()
seprated_letters = letters[1:len(letters) - 1]
result = list()
if len(letters) <= 2:
	print(0)
else:
	for i in seprated_letters.split(', '):
		if i not in result:
			result.append(i)
	print(len(result))


(z, zz) = (input, lambda : list(map(int, z().split())))
zzz = lambda : [int(i) for i in stdin.readline().split()]
(szz, graph, mod, szzz) = (lambda : sorted(zz()), {}, 10 ** 9 + 7, lambda : sorted(zzz()))
from string import *
from re import *
from collections import *
from queue import *
from sys import *
from collections import *
from math import *
from heapq import *
from itertools import *
from bisect import *
from collections import Counter as cc
from math import factorial as f
from bisect import bisect as bs
from bisect import bisect_left as bsl
from itertools import accumulate as ac

def lcd(xnum1, xnum2):
	return xnum1 * xnum2 // gcd(xnum1, xnum2)

def prime(x):
	p = ceil(x ** 0.5) + 1
	for i in range(2, p):
		if x % i == 0 and x != 2 or x == 0:
			return 0
	return 1

def dfs(u, visit, graph):
	visit[u] = True
	for i in graph[u]:
		if not visit[i]:
			dfs(i, visit, graph)
d = set()
for i in z():
	if match('[a-z]', i):
		d.add(i)
print(len(d))


a = input()
arr = []
dic = set()
for i in a:
	if i == '{' or i == '}' or i == ',' or (i == ' '):
		pass
	else:
		dic.add(i)
print(len(dic))


n = input()
a = n.replace('{', '')
b = a.replace('}', '')
c = b.replace(', ', '')
d = ''
for i in range(len(c)):
	if c[i] not in d:
		d = d + c[i]
e = len(d)
print(e)


letters_str: str = input()
if letters_str[1:-1] == '':
	print(0)
else:
	letters: list = letters_str[1:-1].split(sep=', ')
	print(len(set(letters)))


stri = input().strip('{').strip('}').split(', ')
s = set()
for i in stri:
	if i == '':
		break
	else:
		s.add(i)
print(len(s))


inputString = input()
formattedString = inputString[1:len(inputString) - 1]
myList = list(formattedString.split(', '))
myList = list(dict.fromkeys(myList))
if myList[0] == '':
	print(0)
else:
	print(len(myList))


test = input()
clean = test[1:len(test) - 1].split(', ')
chars = {i for i in clean if i != ''}
print(str(len(chars)))


s = input()
se = set(s)
c = 0
for x in se:
	if x.isalpha():
		c += 1
print(c)


try:
	s = input()
	s = s.replace('{', '')
	s = s.replace('}', '')
	s = s.replace(', ', '')
	arr = [x for x in s]
	print(len(set(arr)))
	pass
except Exception:
	pass


st = str(input())
st = st.replace('{', '')
st = st.replace('}', '')
st = st.replace(',', '')
st = st.replace(' ', '')
l = list(st)
l.sort()
if len(l) > 0:
	sym = l[0]
	d = 1
	for i in range(1, len(l)):
		if not l[i] == sym:
			d += 1
			sym = l[i]
else:
	d = 0
print(d)


st = input()
st = st[1:len(st) - 1]
if st != '':
	s = set(list(st.split(', ')))
	print(len(s))
else:
	print(0)


n = input()
s = 'abcdefghijklmnopqrstuvwxyz'
ar = []
for i in n:
	if i in s:
		ar.append(i)
print(len(set(ar)))


str = input().split(',')
a = 'a'
ch = []
x = []
s = []
r = 0
for i in range(0, 26):
	ch.append(a)
	a = chr(ord(a) + 1)
for i in range(0, 26):
	x.append(0)
for i in range(len(str)):
	for j in range(2):
		if str[i][j].isalpha():
			s.append(str[i][j])
res = len(s)
if res != 0:
	for i in range(len(s)):
		for j in range(0, 26):
			if s[i] == ch[j]:
				x[j] += 1
	for i in range(0, 26):
		if x[i] != 0:
			r += 1
	print(r)
else:
	print(0)


lis = input()
if len(lis) > 2:
	lis = lis[1:-1].split(', ')
	print(len(set(lis)))
else:
	print(0)


inp = input()
if len(inp) == 2:
	print(0)
else:
	inp = inp[1:len(inp) - 1]
	inp = inp.split(', ')
	inp2 = []
	count = 0
	for i in inp:
		if i not in inp2:
			inp2.append(i)
			count += 1
	print(count)


n = input()
if len(n) > 2:
	s = n.replace('{', '')
	a = s.replace('}', '')
	b = a.replace(' ', '')
	x = b.split(',')
	l = set(x)
	print(len(l))
else:
	print('0')


str = input()
a = []
for x in str:
	if x in 'qwertyuiopasdfghjklzxcvbnm' and x not in a:
		a.append(x)
print(len(a))


s = input()
alth = 'qwertyuiopasdfghjklzxcvbnm'
alth2 = [0] * 27
for i in s:
	alth2[alth.find(i)] = 1
print(sum(alth2) - alth2[-1])


inp = input()
res = [0 for i in range(30)]
for c in inp:
	if ord('a') <= ord(c) <= ord('z'):
		res[ord(c) - ord('a')] = 1
print(sum(res))


string = input()
unique = []
for char in string[:]:
	if char not in unique:
		unique.append(char)
if len(string) == 2:
	print(0)
elif len(string) == 3:
	print(1)
else:
	print(len(unique) - 4)


j = input()
i = 1
l = []
while i < len(j):
	if j[i] == '}':
		break
	l.append(j[i])
	i = i + 3
d = set(l)
i = 0
for j in d:
	i = i + 1
print(i)


s = input()
mn = set()
smb = [',', ' ', '{', '}']
for i in s:
	if not i in smb:
		mn.add(i)
print(len(mn))


x = input()
x = x.strip('{}')
x = x.split(', ')
s = ''
for i in range(len(x)):
	if x[i] not in s:
		s += x[i]
print(len(s))


n = input()
temp = n.replace(' ', '')
temp1 = ' '.join(temp)
temp2 = temp1.split()
temp3 = set(temp2)
temp4 = list(temp3)
if len(temp4) == 3:
	output = 1
else:
	output = max(len(temp4) - 3, 0)
print(output)


str1 = input()
if str1 == '{}':
	print(0)
else:
	str1 = str1.strip('{')
	str1 = str1.strip('}')
	L = str1.split(', ')
	L2 = list(set(L))
	print(len(L2))


a = input()
t = []
for i in range(len(a)):
	if a[i] == '{' or a[i] == ',' or a[i] == '}' or (a[i] == ' '):
		continue
	else:
		s = a[i].lstrip(' ')
		t.append(s)
t = list(set(t))
print(len(t))


import re
s = set()
for i in re.sub('{|}', '', str(input().split(','))):
	if i.isalpha():
		s.add(i)
print(len(s))


let = input().strip('{}').split(', ')
letdict = {}
for i in let:
	if i not in letdict:
		letdict[i] = 0
if '' in letdict:
	print(0)
else:
	print(len(letdict.keys()))


from sys import stdin
s = set(map(str, stdin.readline().strip().replace(',', ' ').replace('}', ' ').replace('{', ' ').split()))
print(len(s))


letter = []
n = 0
for i in input():
	if i not in letter and i != ' ' and (i != ',') and (i != '{') and (i != '}'):
		letter.append(i)
		n += 1
print(n)


import sys
import string
s = str(input())
l = []
for character in s:
	if character in string.ascii_lowercase:
		l.append(character)
print(len(set(l)))


q = input()
t = []
for i in q:
	if ord(i) >= 97 and ord(i) <= 122:
		t.append(i)
s = set(t)
print(len(s))


line = input()
line = line[1:len(line) - 1]
line = line.split(', ')
line.sort()
ans = 0
if len(line) > 1:
	ans = 1
	for i in range(len(line) - 1):
		if line[i] != line[i + 1]:
			ans += 1
elif line[0] != '':
	ans = 1
print(ans)


s = str(input())
s = s.replace('{', '')
s = s.replace('}', '')
s = s.replace(',', '')
s = s.replace(' ', '')
S = set(s)
x = len(S)
print(x)


SET = input()
LIST = list(SET)
n = len(LIST)
Res = []
for i in range(1, n - 1):
	if LIST[i] != ' ' and LIST[i] != ',':
		Res.append(LIST[i])
realset = set(Res)
print(len(realset))


a = input()
b = int(len(a) / 3)
c = []
if b == 0:
	print(0)
else:
	for i in range(b):
		x = 0
		r = a[3 * i + 1]
		for j in range(len(c)):
			if r == c[j]:
				x = 1
		if x == 0:
			c.append(r)
	print(len(c))


s = input()
s1 = set(s)
c = len(s1)
if s == '{}':
	print(0)
elif c == 3:
	print(1)
else:
	print(c - 4)


s = input()
s = s[1:len(s) - 1]

def wh(s):
	return s.strip()
if s == '':
	print(0)
else:
	p = list(map(wh, s.split(',')))
	q = set(p)
	print(len(q))


x = input()
length = len(x)
if length < 3:
	print('0')
else:
	x = x[1:length - 1]
	x = x.split(', ')
	s = set(x)
	print(len(s))


n = input()
result = []
for i in n:
	if i.isalpha() == True:
		result.append(i)
print(len(set(result)))


inp1 = input()
r = set()
for i in inp1:
	if i.isalnum() == True:
		r.add(i)
print(len(r))


def main(cad):
	if cad == '{}':
		print('0')
	else:
		lista = cad[1:len(cad) - 1].split(',')
		for i in range(len(lista)):
			lista[i] = lista[i].replace(' ', '')
		print(len(set(lista)))
cad = str(input())
main(cad)


s = input()
list = []
i = 1
while i < len(s):
	x = ''
	while s[i] != ',' and s[i] != '}' and (s[i] != ' ') and (i < len(s)):
		x += s[i]
		i += 1
	if x != '' and (not x in list):
		list.append(x)
	else:
		i += 1
print(len(list))


s = input()
s = s.strip()
s = s[1:len(s) - 1]
s = s.split(', ')
k = len(set(s))
if s[0] == '':
	k = 0
print(k)


str1 = input()
l1 = []
for i in range(len(str1)):
	if 97 <= ord(str1[i]) <= 122:
		l1.append(str1[i])
print(len(set(l1)))


s = input()
s2 = s[1:len(s) - 1]
r = set()
for i in s2:
	if i != ',' and i != ' ':
		r.add(i)
print(len(r))


x = input()
if len(x) == 2:
	print(0)
else:
	s = []
	x = x[1:len(x) - 1].split(',')
	for i in x:
		if i[0] == ' ':
			s.append(i[1:])
		else:
			s.append(i)
	p = []
	for i in s:
		if i not in p:
			p.append(i)
	print(len(p))


s = input()[1:-1]
s = set(s)
if len(s) < 2:
	print(len(s))
else:
	print(len(s) - 2)


def read_array():
	x = []
	x1 = []
	x = input()
	x = x.replace(' ', '')
	x = x.replace('{', '')
	x = x.replace('}', '')
	x = x.split(',')
	return x
x = read_array()
y = []
for val in x:
	if not val in y:
		y.append(val)
if '' in y:
	print(len(y) - 1)
else:
	print(len(y))


s = input()
(x, s, y) = (s[0], s[1:-1], s[-1])
if len(s) == 0:
	print(0)
	exit()
s = list(map(str, s.split(', ')))
list1 = []
for i in range(0, len(s)):
	if s[i] not in list1:
		list1.append(s[i])
print(len(list1))


a = input()
b = a.replace('{', '')
a = b.replace('}', '')
b = a.split(', ')
f = set(b)
if f == {''}:
	print('0')
else:
	print(len(f))


n = input()
n = n.replace('{', '')
n = n.replace('}', '')
n = n.replace(' ', '')
n = list(n.split(','))
n = list(map(str.strip, n))
if len(set(n)) >= 1 and n[0] != '':
	print(len(set(n)))
else:
	print(0)


word = str(input())
if word.strip() == '{}':
	print(0)
else:
	print(len(set(list(str(word).strip().replace('{', '').replace('}', '').split(', ')))))


import re
a = input()
if a == '{}':
	print(0)
	exit()
a = re.split('{|}|, ', a)
a = a[1:len(a) - 1]
b = list(set(a))
print(len(b))


def main():
	line = input()
	line = line[1:-1]
	s = line.split(', ')
	alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
	out = [0] * len(alphabet)
	for i in range(len(s)):
		for j in range(len(alphabet)):
			if s[i] == alphabet[j]:
				out[j] += 1
	result = 0
	for i in range(len(out)):
		if out[i] != 0:
			result += 1
	print(result)
main()


n = input()
arr = []
for i in range(0, len(n)):
	if ord(n[i]) >= 97 and ord(n[i]) <= 122:
		arr.append(n[i])
print(len(set(arr)))


def unique(list1):
	list_set = set(list1)
	unique_list = list(list_set)
	print(len(unique_list))
val = input()
val = val.replace('{', '')
val = val.replace('}', '')
val = val.replace(' ', '')
val = val.replace('\r', '')
if not val:
	print('0')
else:
	temp = val.split(',')
	unique(temp)


x = map(str, input())
s = set()
for i in x:
	if i.isalpha():
		s.add(i)
	else:
		pass
print(len(s))


s = str(input())
c = 0
arr = []
for i in s:
	if i.isalpha():
		if i not in arr:
			arr.append(i)
			c += 1
print(c)


a = input()
l = []
p = [chr(i) for i in range(97, 97 + 26)]
for i in range(len(a)):
	if a[i] in p:
		if a[i] not in l:
			l.append(a[i])
print(len(l))


s = input()
l = s.split(',')
seen = set()
for i in range(len(l)):
	if len(l[i]) == 2:
		seen.add(l[i][-1])
	else:
		seen.add(l[i][1])
if len(s) == 2:
	print(0)
else:
	print(len(seen))


S = input()
A = []
for i in set(S):
	if i != '{' and i != '}' and (i != ',') and (i != ' '):
		A.append(i)
print(len(A))


n = input()
if len(n) == 2:
	print('0')
else:
	n = n.replace('{', '')
	n = n.replace('}', '')
	n = n.replace(',', '')
	n = n.replace(' ', '')
	x = n
	for i in range(len(n)):
		x = x.replace(n[i], '')
		x = x + n[i]
	print(len(x))


def AntonAndLetters(letters):
	characters = [x.strip() for x in letters[1:len(letters) - 1].split(',')]
	if len(characters) == 1 and characters[0] == '':
		return 0
	distinctCharacters = []
	for c in characters:
		if not c in distinctCharacters:
			distinctCharacters.append(c)
	return len(distinctCharacters)
letters = input()
print(AntonAndLetters(letters))


s = list(input())
s.remove('{')
s.remove('}')
s[:] = (value for value in s if value != ',' and value != ' ')
print(len(set(s)))


a = str(input())
k = []
s = list(a)
for i in s:
	if 'a' <= i <= 'z':
		if i in k:
			pass
		else:
			k.append(i)
print(len(k))


s = input()
s = list(s[1:-1].split(', '))
dem = dict()
for i in s:
	if i == '':
		continue
	if i in dem:
		dem[i] += 1
	else:
		dem[i] = 0
print(len(dem))


line = [str(i) for i in input() if i != '{' and i != '}' and (i != ',') and (i != ' ')]
if len(line) == 0:
	print('0')
else:
	line_1 = set(line)
	print(len(line_1))


n = input()
n = n.replace('{', '')
n = n.replace('}', '')
n = n.replace(',', '')
n = n.replace(' ', '')
l = []
if len(n) != 0:
	for i in range(len(n)):
		if n[i] not in l:
			l.append(n[i])
	print(len(l))
else:
	print('0')


s = input()
s = s[1:-1]
c = [0] * 26
r = 0
for e in s:
	if ord(e) >= 97 and ord(e) <= 122:
		c[ord(e) - 97] += 1
		if c[ord(e) - 97] == 1:
			r += 1
print(r)


s = input().replace(' ', '')
s = s[1:len(s) - 1:1]
if not s:
	print(0)
else:
	m = set(map(str, s.split(',')))
	print(len(m))


n = list(input())
if n == '{}':
	print(0)
else:
	n.remove('{')
	n.remove('}')
	n = set(n)
	if ' ' in n:
		n.remove(' ')
	if ',' in n:
		n.remove(',')
	print(len(n))


s = str(input())
if s == '{}':
	print(0)
else:
	s = list(s)
	s_l = []
	for i in range(1, len(s), 3):
		if s[i] not in s_l:
			s_l.append(s[i])
	print(len(s_l))


n = str(input())
r = ''.join(set(n))
re = list(r)
k = 'abcdefghijklmnopqrstuvwxyz'
c = 0
for i in range(len(re)):
	if re[i] in k:
		c += 1
print(c)


s = input()
if s == '{}':
	print('0')
else:
	s.replace(' ', '')
	newS = s[1:-1]
	arr = newS.split(', ')
	print(len(set(arr)))


def main():
	s = input()
	se = []
	for i in s:
		if i.isalpha():
			se.append(i)
	print(len(set(se)))
main()


s = input()
l = []
s = s.replace('{', '')
s = s.replace('}', '')
s = s.replace(',', '')
s = s.replace(' ', '')
for i in range(len(s)):
	l.append(s[i])
s = set(l)
print(len(s))


import re
s = input()
r = re.sub('[{},]', '', s)
x = list(r)
for t in r:
	if t is ' ':
		x.remove(' ')
k = list(x)
m = set(k)
result = len(m)
print(result)


import string
for x in string.ascii_lowercase:
	globals()[x] = ord(x)
print(len(eval(input())))


l = input()
if l == '{}':
	print(0)
else:
	l = list(l)
	k = []
	for i in range(len(l)):
		if 'a' <= l[i] <= 'z':
			k += l[i]
	k.sort()
	a = k[0]
	s = 1
	for i in range(len(k)):
		if not k[i] == a:
			s += 1
			a = k[i]
	print(s)


s = input()
if len(s) <= 2:
	print(0)
else:
	s = s[1:len(s) - 1]
	a = list(map(str, s.split(', ')))
	print(len(set(a)))


set1 = set(input())
unique_count = 0
for i in set1:
	if i != '{' and i != ',' and (i != ' ') and (i != '}'):
		unique_count += 1
print(unique_count)


from sys import *
input = stdin.readline
s = input()
res = set()
for i in s:
	if 96 < ord(i) < 123:
		res.add(i)
print(len(res))


l = input()
a = []
n = 0
for i in l:
	if i.isalpha() and i not in a:
		a.append(i)
		n += 1
print(n)


A = list(input())
n = len(A)
A.remove('{')
A.remove('}')
for i in range(int(n / 3 - 1)):
	A.remove(',')
	A.remove(' ')
l = list(set(A))
print(len(l))


s = input()
s = s.strip('{')
s = s.strip('}')
s = ''.join(s.split())
lst = s.split(',')
l2 = list(set(lst))
if s == '':
	print(0)
else:
	print(len(l2))


chars = input().strip().split(', ')
n = len(chars)
if n == 1:
	if len(chars[0]) == 2:
		print(0)
	else:
		print(1)
else:
	chars[0] = chars[0][-1]
	chars[-1] = chars[-1][0]
	print(len(set(chars)))


a = input()
alp = 'abcdefghijklmnopqrstuwvxyz'
b = ''
for i in a:
	if i not in b and i in alp:
		b += i
print(len(b))


s = input()
a = [0 for i in range(26)]
for i in s:
	if ord(i) in range(97, 123):
		a[ord(i) - 97] += 1
count = 0
for i in a:
	if i != 0:
		count += 1
print(count)


a = input()
a = a.replace(',', '')
a = a.replace('{', '')
a = a.replace('}', '')
b = set(a.split())
print(len(b))


a = input()
b = []
for i in range(len(a)):
	if a[i] != '{' and a[i] != '}' and (a[i] != ',') and (a[i] != ' '):
		b.append(a[i])
print(len(set(b)))


def main():
	a = input()
	b = len(a)
	list1 = []
	for i in range(b):
		list1 += [a[i]]
	set1 = set(list1)
	if ',' in a:
		out = len(set1) - 4
		print(out)
	elif a == '{}':
		print('0')
	else:
		print('1')
main()


n = input()
mnoj = []
for i in n:
	if i != '{' and i != '}' and (i != ',') and (i != ' '):
		mnoj.append(i)
print(len(set(mnoj)))


text = input().replace(',', '').replace('{', '').replace('}', '').split()
result = []
for i in range(len(text)):
	if text[i] not in result:
		result.append(text[i])
print(len(result))


print(len(set([i for i in input().strip() if i != '{' and i != '}' and (i != ',') and (i != ' ')])))


s = input()
ans = set()
for i in s:
	if 122 >= ord(i) >= 97:
		ans.add(i)
print(len(ans))


x = input()
t = ''
for i in x:
	if i != '{' and i != '}' and (i != ',') and (i != ' '):
		t += i
p = ''
for i in t:
	if i not in p:
		p += i
print(len(p))


mylist = input()
unique = []
for i in mylist:
	if i == '{' or i == '}' or i == ' ' or (i == ','):
		continue
	if i not in unique:
		unique.append(i)
print(len(unique))


strInput = input()
leng = len(strInput)
strI = strInput[1:leng - 1].split(', ')
finalList = []
[finalList.append(i) for i in strI if i not in finalList]
if len(strInput) == 2:
	print('0')
else:
	print(len(finalList))


n = input()
s = n.replace('{', '')
s = s.replace('}', '')
l = len(s)
if l == 0:
	print('0')
else:
	s = s.replace(',', '')
	s = s.replace(' ', '')
	si = set(s)
	print(len(si))


s = input()
res = []
for x in s:
	if x not in ('{', '}', ',', ' '):
		res.append(x)
print(len(set(res)))


data = input()[1:-1]
letters = set(data.split(', ')) if data else []
count = len(letters)
print(count)


c = set(input())
c.discard('{')
c.discard('}')
c.discard(' ')
c.discard(',')
print(len(c))


sequence = [i.replace('{', '').replace(',', '').replace('}', '') for i in input().split(' ')]
if sequence[0] == '':
	print(0)
else:
	print(len(set(sequence)))


str1 = input()
total = 0
for i in [chr(x) for x in range(97, 123)]:
	if i in str1:
		total += 1
	else:
		total += 0
print(total)


s = input()[1:-1]
if s == '':
	print(0)
else:
	print(set(s.split(', ')).__len__())


line = input()
line2 = set(line)
arr = []
for i in line2:
	if i not in {'{', '}', ',', ' '}:
		arr.append(i)
print(len(arr))


n = input().strip('{')
n = n.strip('}')
n = n.split(', ')
if n == ['']:
	a = []
else:
	a = list(set(n))
print(len(a))


n = input()
c = list(n)
l = []
for i in range(len(c)):
	if c[i] != '{' and c[i] != ',' and (c[i] != '}') and (c[i] != ' '):
		if c[i] not in l:
			l.append(c[i])
print(len(l))


def main():
	s = list(input())
	count = 0
	alphabet = [0 for i in range(26)]
	for c in s:
		if c == '{' or c == '}' or c == ',' or (c == ' '):
			continue
		index = ord(c) - 97
		if alphabet[index] == 0:
			count += 1
		alphabet[index] = 1
	print(count)
main()


a = input()
a = a[1:len(a) - 1]
a = a.replace(',', '')
a = a.replace(' ', '')
b = []
for i in a:
	if i not in b:
		b.append(i)
print(len(b))


s = input()
l = [i for i in s if i.isalpha()]
print(len(list(set(l))))


def not_null(x):
	return x != ''
print(sum((not_null(x) for x in set(input()[1:-1].split(', ')))))


a = str(input())
a = a.replace('{', '')
a = a.replace('}', '')
n = 0
a = a.split(', ')
k = [0]
m = 'qwertyuiopasdfghjklzxcvbnm'
a = sorted(a)
for i in range(len(a)):
	if m.count(a[i]) == 1:
		m = m.replace(a[i], '')
		n = n + 1
print(n)


def main():
	s = input()
	s = set(s[1:-1].replace(',', ' ').split())
	print(len(s))
main()


listOfLetters = input().replace('{', '').replace('}', '').split(', ')
if listOfLetters == ['']:
	print(0)
else:
	print(len(set(listOfLetters)))


t = input()
t = set(t)
count = 0
for i in t:
	if i != ',' and i != '}' and (i != '{') and (i != ' '):
		count = count + 1
print(count)


import re
s = input()
lst = re.findall('[a-z]+', s)
counts = dict()
for i in lst:
	counts[i] = counts.get(i, 0) + 1
print(len(counts))


inputLine = str(input())
countedList = []
letter = 0
for i in range(0, len(inputLine)):
	if ord(inputLine[i]) in range(65, 123) and inputLine[i] not in countedList:
		countedList.append(inputLine[i])
		letter += 1
print(letter)


b = input().rstrip()
if b[1] == b[-1]:
	print(0)
else:
	print(len(set(b[1:-1].split(', '))))


s = input()
s = s[1:-1]
l = []
for i in s:
	l.append(i)
while ',' in l:
	l.remove(',')
while ' ' in l:
	l.remove(' ')
print(len(set(l)))


n = input()
if n != '{}':
	a = ''
	for i in range(1, len(n) - 1):
		a += n[i]
	str0 = list(a.split(', '))
	str_org = []
	for s in str0:
		if s not in str_org:
			str_org.append(s)
	print(len(str_org))
else:
	print(0)


st = list(input())
s = set()
for i in range(len(st)):
	if ord(st[i]) >= 65 and ord(st[i]) <= 90 or (ord(st[i]) >= 97 and ord(st[i]) <= 122):
		s.add(st[i])
print(len(s))


string = input()
string = string.replace(', ', ' ')
print(len(set(string[1:-1].split())))


s = input()
x = {'{', ',', ' ', '}'}
s1 = []
for i in s:
	if i not in x:
		s1.append(i)
print(len(set(s1)))


s = set(input()[1:-1].split(', '))
print(len(s) if '' not in s else 0)


from collections import OrderedDict
s = input()
s = s[1:]
s = s[::-1]
s = s[1:]
s = s[::-1]
s = list(s)
u = list(OrderedDict.fromkeys(s))
k = len(u)
if ',' in u:
	k -= 1
if ' ' in u:
	k -= 1
print(k)


s = input()
s = s[1:-1].split(', ')
s = set(s)
s = set(filter(lambda c: len(c) == 1, s))
print(len(s))


a = input()
s = {0}
for i in a:
	if i.isalpha():
		s.add(i)
s.remove(0)
print(len(s))


s = str(input())
s = s.strip('{}')
s = s.split(', ')
if s == ['']:
	print('0')
else:
	s = set(s)
	print(len(s))


s = list(input()[1:-1].replace(',', '').split())
u = []
for i in s:
	if i not in u:
		u.append(i)
print(len(u))


s = input().replace('{', '').replace('}', '').split(',')
dp = set()
for i in s:
	i = i.strip()
	if i != '':
		dp.add(i)
ans = len(dp)
print(ans)


letters = input()
s = set(letters)
count = 0
for letter in s:
	if letter.isalpha():
		count += 1
print(count)


n = input()
s = set(n[1:len(n) - 1])
l = set()
for i in s:
	if i == ' ' or i == ',':
		pass
	else:
		l.add(i)
print(len(l))


line = input().lstrip('{').rstrip('}')
s = [x.strip() for x in line.split(',')]
if s and s[0] == '':
	print(0)
else:
	print(len(set(s)))


s = input()
l = set([s[x] for x in range(len(s)) if s[x].isalpha()])
print(len(l))


l = set(list(input()))
c = 0
for i in l:
	if 'a' <= i <= 'z':
		c += 1
print(c)


from collections import Counter
a = list(input())
i = 0
b = []
while i < len(a):
	b.append(ord(a[i]))
	i = i + 1
c = []
i = 0
while i < len(b):
	if b[i] > 96 and b[i] < 123:
		c.append(b[i])
	i = i + 1
count = Counter(c)
print(len(count))


n = [each for each in input() if each != ' ' and each != '}' and (each != '{') and (each != ',')]
print(len(set(n)))


s = input()
l = []
for i in s:
	if i not in l:
		l.append(i)
if len(l) == 2:
	print(0)
elif len(l) == 3:
	print(1)
else:
	print(len(l) - 4)


s = input()
l = [str(x) for x in str(s)]
m = []
for i in l:
	if i != ' ' and i != '{' and (i != '}') and (i != ','):
		m.append(i)
print(len(set(m)))


s = input()
counted = 'a'
counter = 0

def repeating(ch):
	for c in range(1, len(counted)):
		if counted[c] == ch:
			return True
	return False
i = 1
while i < len(s) and s[i] != '}':
	if not repeating(s[i]):
		counter += 1
		counted += s[i]
	i += 3
print(counter)


x = input()
m = []
for i in x:
	if i.isalpha():
		m.append(i)
m = set(m)
print(len(m))


n = input()
k = 0
seen = set()
uniq = [x for x in n if x not in seen and (not seen.add(x))]
u = [x for x in uniq if x not in '{,} ']
print(len(u))


inp = str(input())
inp = inp.replace('{', '')
inp = inp.replace('}', '')
inp = inp.replace(',', '')
inp = inp.replace(' ', '')
print(len(set(inp)))


n = input()
a = n[1:-1]
b = {}
b = set(b)
for i in a:
	if i != ',' and i != ' ':
		b.add(i)
print(len(b))


k = input()
I = []
for i in k:
	if i.islower() == True and i not in I:
		I.append(i)
print(len(I))


a = input()
s = set()
for i in a:
	if i not in ['}', ',', '{', ' ']:
		s.add(i)
print(len(s))


sent = input()
sent_f = sent[1:-1]
lis = sent_f.split(', ')
if sent == '{}':
	print(0)
else:
	print(len(list(set(lis))))


s = input()[1:-1]
letters = set()
for l in s:
	if l != ' ' and l != ',':
		letters.add(l)
print(len(letters))


def solve(a_list):
	count_list = [0] * 26
	for n in a_list:
		count_list[ord(n) - 97] = 1
	return sum(count_list)

def main():
	the_input = input()
	a_list = filter(lambda x: x.isalpha(), the_input)
	print(solve(a_list))
main()


a = input().split()
arr = []
if a[0] == '{}':
	print(0)
else:
	for i in a:
		if '{' in i and ',' in i:
			arr.append(i[1])
		elif ',' in i:
			arr.append(i[0])
		elif '}' in i:
			arr.append(i[0])
	print(len(set(arr)))


list1 = list(input())
print(int(len(set(list1)) - 3 - abs(len(set(list1)) - 4) / (len(set(list1)) - 4)))


n = input()
l = n[1:-1]
m = set(''.join(l.replace(',', ' ').split()))
print(len(m))


string = input()
string = string.replace('{', '')
string = string.replace('}', '')
string = string.replace(',', '')
My_list = string.split()
My_list = set(My_list)
print(len(My_list))


import re
s = input()
lis1 = re.split('[{}\\, ]', s)
while '' in lis1:
	lis1.remove('')
print(len(list(set(lis1))))


s = set()
i = input()
for y in range(len(i)):
	if i[y] == ',' or i[y] == '{' or i[y] == '}' or (i[y] == ' '):
		continue
	else:
		s.add(i[y])
print(len(s))


a = input()
letters = []
for i in range(0, len(a)):
	if a[i].isalpha():
		letters.append(a[i])
letters = set(letters)
print(len(letters))


s = input()
l = len(s)
s = s[1:l - 1]
li = []
for i in s:
	if not i == ',' and (not i == ' '):
		li.append(i)
li = set(li)
print(len(li))


string = input()
if string == '{}':
	num = 0
else:
	word = string[1:-1]
	L = word.split(', ')
	N = set(L)
	M = list(N)
	num = len(M)
print(num)


l = set(input())
s = 0
for i in l:
	if i.isalpha():
		s += 1
print(s)


isDebug = False
s = input().replace(' ', '').replace('{', '').replace('}', '')
ls = s.split(',')
if isDebug:
	print(f'len(s)={len(s)}')
	print(f'ls={ls}')
	print(f'not ls={not ls}')
	print(f'len(ls)={len(ls)}')
ss = set(ls)
print(0 if len(s) is 0 else len(ss))


a = input()[1:-1]
print(min(len(set(a.split(', '))), len(a)))


a = input()
b = []
n = 0
table = list('qwertyuiopasdfghjklzxcvbnm')
for i in range(len(a)):
	if a[i] in table:
		b.append(a[i])
b = sorted(b)
for i in range(len(b) - 1):
	if b[i + 1] == b[i]:
		b[i] = None
for i in range(len(b)):
	if b[i] != None:
		n += 1
print(n)


s = input()
d = {}
for i in range(len(s)):
	if ord(s[i]) >= 97 and ord(s[i]) <= 122:
		d[s[i]] = 1
print(len(d))


n = str(input())
n2 = set(n[1:-1:3])
print(len(n2))


s = input()
cnt = 0
lis = []
for i in range(0, len(s)):
	if s[i] >= 'a' and s[i] <= 'z':
		if s[i] not in lis:
			cnt += 1
			lis.append(s[i])
print(cnt)


a = input()
a = a[1:len(a) - 1].split(',')
m = []
for i in a:
	if i.strip() not in m and i != '':
		m.append(i.strip())
print(len(m))


str = input()
list1 = list(str)
set1 = set(list1)
set1.remove('{')
set1.remove('}')
if len(list1) > 3:
	set1.remove(',')
	set1.remove(' ')
print(len(set1))


t = input()
t = ''.join((e for e in t if e.isalnum()))
t = ''.join(set(t))
x = len(t)
print(x)


st = ''
st += input()
em = ''
for i in st:
	if i != '{' and i != '}' and (i != ',') and (i != ' '):
		em += i
print(len(set(em)))


s = input()
l = []
for i in s:
	if i != '{' and i != ',' and (i != '}') and (i != ' '):
		l.append(i)
l1 = len(l)
l2 = len(set(l))
print(l1 - (l1 - l2))


s = set()
n = input()
for i in n:
	if i != '{' and i != '}' and (i != ',') and (i != ' '):
		s.add(i)
print(len(s))


a = list(input())
print(len(set(a[1:len(a) - 1:3])))


import sys

def solve(xs):
	return len(xs)

def print_stderr(*args, **kwargs):
	print(*args, file=sys.stderr, **kwargs)

def main():
	xs = {x.strip() for x in input().strip('{}').split(',') if x}
	result = solve(xs)
	print(result)
main()


raw_input = input()
if len(raw_input) == 2:
	print(0)
elif len(raw_input) == 3:
	print(1)
else:
	letters = raw_input[1:-1].split(', ')
	letter_dict = dict()
	for i in letters:
		letter_dict[i] = letter_dict.get(i, 0) + 1
	print(len(letter_dict.items()))


s = str(input())
if s == '{}':
	print(0)
else:
	s = s[1:-1]
	l = s[-1]
	s = s[:-1]
	u = [l]
	for i in range(len(s) // 3):
		if s[0] not in u:
			u.append(s[0])
		s = s[3:]
	print(len(u))


a = input()
b = set(a)
if len(b) <= 3:
	print(len(b) - 2)
else:
	print(len(b) - 4)


s = input()
s = s.replace('{', '')
s = s.replace('}', '')
s = s.replace(' ', '')
A = s.split(',')
if len(A) == 1 and A[0] == '':
	print(0)
else:
	print(len(set(A)))


s = input()
count = 0
for a in range(97, 123):
	if chr(a) in s:
		count += 1
print(count)


a = list(input())
alpha = [0] * 26
i = 1
if len(a) > 2:
	while i < len(a):
		alpha[ord(a[i]) - 97] += 1
		i += 3
	print(26 - alpha.count(0))
else:
	print(0)


A = input()
n = len(A) // 3
list1 = []
for i in range(n):
	nu = 3 * i + 1
	list2 = [A[nu]]
	if (A[nu] in list1) == True:
		c = 0
	else:
		list1 = list1 + list2
print(len(list1))


s = input()
s = s.replace(',', '')
s = s.replace('{', '')
s = s.replace('}', '')
letter = list(s.split())
letter = sorted(letter, key=lambda x: ord(x))
b = 0
while b < len(letter) - 1:
	if letter[b] == letter[b + 1]:
		letter.pop(b + 1)
	else:
		b += 1
print(len(letter))


a = set(map(str, input().lstrip('{').rstrip('}').split(', ')))
print(len(a) if list(a)[0] != '' else 0)


s = str(input())
p = []
p += s
a = 0
c = 0
for i in range(len(p)):
	if ord(p[i]) < 97 or ord(p[i]) > 122:
		c = 1
	while c == 0:
		for j in range(i):
			if p[j] == p[i]:
				c = 1
				break
		break
	if c == 0:
		a += 1
	c = 0
print(a)


x = input()
x = list(x)
c = -1
if len(x) < 4:
	c = 1
for i in range(0, len(x)):
	a = 0
	for j in range(0, i):
		if x[i] == x[j]:
			a += 1
	if a == 0:
		c += 1
print(c - 3)


seq = input()
chars = set()
for char in seq:
	if char == '{' or char == '}' or char == ' ' or (char == ','):
		pass
	else:
		chars.add(char)
print(len(chars))


n = str(input())
print([len(set(n[1:len(n) - 1].split(', '))), 0][n == '{}'])


import sys
a = set()
res = 0
inp = input()[1:-1]
if inp != '':
	for e in inp.split(', '):
		if e not in a:
			a.add(e)
	sys.stdout.write('{}'.format(len(a)))
else:
	sys.stdout.write('0')


letters = []
dL = []
line = input()
line = list(line)
l = len(line)
for i in range(0, l):
	if 'a' <= line[i] <= 'z':
		letters.append(line[i])
dL = list(dict.fromkeys(letters))
n = len(dL)
print(n)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	s = S()
	if s == '{}':
		return 0
	a = set(s[1:-1].split(', '))
	return len(a)
print(main())


inp = input()
if len(inp) == 2:
	print('0')
else:
	inp = inp[1:-1].split(', ')
	print(len(set(inp)))


p = list(map(str, input()))
for i in range(len(p)):
	for j in range(len(p)):
		if p[i] == p[j] and i != j:
			p[i] = -1
g = []
for i in range(len(p)):
	if p[i] != -1 and p[i] != '{' and (p[i] != '}') and (p[i] != ',') and (p[i] != ' '):
		g.append(p[i])
print(len(g))


from sys import stdin, stdout
string = stdin.readline().strip()
string = string.split('{')[1].split('}')[0].split(',')
if len(''.join(string)) == 0:
	print(0)
	exit()
st = set()
for ch in string:
	st.add(ch.strip())
print(len(st))


s = input()
s = s.strip('{}')
s = s.split(', ')
s = set(s)
print(0) if '' in s else print(len(s))


a = input()[1:-1].split(', ')
try:
	a.remove('')
except:
	pass
every = list(set(a))
print(len(every))


z = input().split(', ')
z[0] = z[0][1:]
z[-1] = z[-1][:-1]
if z[0] == '':
	print(0)
else:
	z = set(z)
	print(len(z))


a = input()
if a == '{}':
	print(0)
else:
	b = a[1:-1]
	c = list(b.split(', '))
	count = 0
	for i in range(len(c)):
		if c[i] not in c[i + 1:len(a)]:
			count += 1
	print(count)


I = input()
N = set(I.strip('{}').split(', ')) if I != '{}' else []
print(len(N))


s = input()
s = sorted(set(s[1:-1].split(', ')))
if s[0] == '':
	s = s[1:]
print(len(s))


import re
from collections import Counter
l = [x for x in list(re.split(' |,|}|{', input())) if x]
print(len(Counter(l)))


s = input()
s = list(s[1:-1].replace(', ', ''))
alpha = [0 for i in range(0, 26)]
count_numbers = 0
for l in s:
	alpha[ord(l) - 97] += 1
for i in range(0, 26):
	if alpha[i] != 0:
		count_numbers += 1
print(count_numbers)


import sys
x = input().split(', ')
if x[0] == '{}':
	print('0')
	sys.exit()
one = x[0].split('{')
last = x[-1].split('}')
x[0] = one[1]
x[-1] = last[0]
c = 0
X = []
for i in x:
	if i not in X:
		X.append(i)
print(len(X))


import operator as op
import re
import sys
from bisect import bisect, bisect_left, insort, insort_left
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from functools import reduce
from itertools import accumulate, combinations, combinations_with_replacement, groupby, permutations, product
from math import acos, asin, atan, ceil, cos, degrees, factorial, gcd, hypot, log2, pi, radians, sin, sqrt, tan
from operator import itemgetter, mul
from string import ascii_lowercase, ascii_uppercase, digits

def inp():
	return int(input())

def inlist():
	return list(map(int, input().split()))

def instr():
	s = input()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())

def def_value():
	return 0
a = input()
res = set()
for i in a:
	if i >= 'a' and i <= 'z':
		res.add(i)
print(len(res))


print(len(set([x for x in input()[1:-1] if not x == ',' and (not x == ' ')])))


user = input()
user = [x.strip() for x in user[1:-1].split(',') if len(user) > 2]
print(len(set(user)))


s = input()
s1 = ''.join((x for x in s if x not in '{, }'))
print(len(set(s1)))


a = input().strip()
x = []
for i in a:
	if i != '{' or i != ',' or i != '}' or (i != ' '):
		x.append(i)
if len(list(set(x))) == 3:
	print(1)
elif len(list(set(x))) < 3:
	print(0)
else:
	print(len(list(set(x))) - 4)


a = input()
b = {}
count = 0
if len(a) > 2:
	for i in range(1, len(a), 3):
		if b.get(a[i]):
			pass
		else:
			b[a[i]] = i
			count += 1
print(count)


s = input()
m = s[1:-1]
a = m.split(', ')
a.sort()
count = 1
w = 'a'
if '' in a:
	print(0)
elif len(a) == 1:
	print(1)
else:
	for i in range(1, len(a)):
		q = a[i]
		if q > w:
			count += 1
			w = a[i]
	print(count)


a = input()
a = a[1:len(a) - 1]
a = a.split(', ')
a = list(set(a))
if len(a) == 1 and a[0] == '':
	a.pop(0)
print(len(a))


a = str(input())
s = 0
for i in range(1, len(a) - 1, 3):
	s = s + 1
	for j in range(1, i, 3):
		if a[i] == a[j]:
			s = s - 1
			break
print(s)


s = list(str(input()))
s = s[1:-1]
S = []
for i in s:
	if i != ' ' and i != ',':
		S.append(i)
r = set(S)
print(len(r))


ques = input()
a = [i for i in ques]
s = set(a)
s.remove('{')
s.remove('}')
if ',' in s:
	s.remove(',')
if ' ' in s:
	s.remove(' ')
print(len(s))


x = input()[1:-1][::3]
unq = []
for i in x:
	if i not in unq:
		unq.append(i)
print(len(unq))


s = input()
l = []
i = 1
while i <= len(s) - 2:
	l.append(s[i])
	i += 3
l.sort()
ans = 0
while l != []:
	b = l.count(l[0])
	ans += 1
	for i in range(0, b):
		l.pop(0)
print(ans)


x = input()
dictp = {}
summation = 0
for i in range(len(x)):
	if x[i] == '{' or x[i] == '}' or x[i] == ',' or (x[i] == ' '):
		continue
	else:
		dictp[x[i]] = 0
for i in range(len(x)):
	if x[i] == '{' or x[i] == '}' or x[i] == ',' or (x[i] == ' '):
		continue
	elif x[i] in dictp:
		dictp[x[i]] = dictp[x[i]] + 1
for keys in dictp:
	if dictp[keys] > 1:
		summation += 1
	else:
		summation += 1
print(summation)


n = input()
c = 0
l = list(set(n))
r = []
for i in l:
	if i.isalpha() and i not in r:
		c += 1
		r.append(i)
print(c)


total = []
text = input()[1:-1].split(', ')
if text[0] == '':
	print(0)
else:
	for a in text:
		if total.count(a) >= 1:
			continue
		else:
			total.append(a)
	print(len(total))


x = input().split(', ')
x[0] = x[0].split('{')[1]
n = 0
x[len(x) - 1] = x[len(x) - 1].split('}')[0]
y = ['' for i in range(len(x))]
for i in range(len(x)):
	t = 0
	for j in range(i + 1):
		if x[i] != y[j]:
			t += 1
	if i == t - 1:
		n += 1
		y[i] = x[i]
print(n)


lista = list(input())
lista = set(lista[1:-1])
if len(lista) > 2:
	lista.remove(',')
	lista.remove(' ')
print(len(lista))


n1 = input()
if len(n1) == 2:
	print(0)
else:
	s = n1.strip('{').strip('}').split(' ')
	l = ''
	for a in s:
		l = l + a
	print(len(set(l.split(','))))


set_old = input()
set_str = ''
for i in range(int(len(set_old) / 3)):
	set_str += set_old[3 * i + 1]
count = 0
cha = 'abcdefghijklmnopqrstuvwxyz'
for i in range(len(cha)):
	if cha[i] in set_str:
		count += 1
print(count)


a = input()
l = []
for i in a:
	if i == '{' or i == '}' or i == ',' or (i == ' '):
		pass
	else:
		l.append(i)
l = set(l)
print(len(l))


s = str(input())
a = []
for _ in range(1, len(s) - 1, 3):
	if s[_] not in a:
		a.append(s[_])
print(len(a))


letter = input()
mylist = []
for char in letter:
	if char == '{' or char == '}' or char == ' ' or (char == ','):
		continue
	else:
		mylist.append(char)
x = set(mylist)
print(len(x))


s = input()
l = len(s)
s = s[1:l - 1]
if len(s) > 0:
	a = [x for x in s.split(', ')]
	print(len(set(a)))
else:
	print(0)


import sys
inf = float('inf')
(mod, MOD) = (1000000007, 998244353)

def get_array():
	return list(map(int, sys.stdin.readline().strip().split()))

def get_ints():
	return map(int, sys.stdin.readline().strip().split())

def input():
	return sys.stdin.readline().strip()
string = input()
myset = set()
for i in string:
	if 'a' <= i <= 'z':
		myset.add(i)
print(len(myset))


n = input()
l = []
s = set()
for i in range(1, len(n), 3):
	l.append(n[i])
s.update(l)
(a, b, c, d) = ('{', '}', ' ', ',')
if a in s or b in s or c in s or (d in s):
	s.discard(a)
	s.discard(b)
	s.discard(c)
	s.discard(d)
print(len(s))


x = list(map(str, input().strip().split()))
y = []
z = []
for i in x:
	if '{' in i:
		if '}' in i:
			if i[1] != '}':
				y.append(i[1])
				break
			else:
				break
		else:
			y.append(i[1])
	else:
		y.append(i[0])
for i in y:
	if i not in z:
		z.append(i)
print(len(z))


from collections import Counter
a = input()
a = a[1:]
a = a[:-1]
a = a.replace(',', '')
a = a.split()
b = Counter(a)
print(len(b.keys()))


def anton(val):
	check_set = set()
	for x in val:
		if '{' in x and '}' in x:
			x = x.replace('}', '').replace('{', '')
			if x == '':
				break
			check_set.add(x)
		if '{' in x:
			check_set.add(x.replace('{', ''))
		elif '}' in x:
			x = x.strip()
			check_set.add(x.replace('}', ''))
		else:
			x = x.strip()
			check_set.add(x)
	val = len(check_set)
	return val
value = list(map(str, input().split(',')))
print(anton(value))


def f(n):
	return n != '{' and n != '}' and (n != ',') and (n != ' ')
print(len(set(filter(f, list(input())))))


a = str(input())
c = ''
for i in range(len(a)):
	if a[i] != '{' and a[i] != '}' and (a[i] != ',') and (a[i] != ' ') and (c.find(a[i]) == -1):
		c += a[i]
print(len(c))


s = list(input())
while ',' in s:
	s.remove(',')
while ' ' in s:
	s.remove(' ')
s.remove('{')
s.remove('}')
print(len(set(s)))


def main():
	ans = {}
	count = 0
	a = input()
	for i in a:
		if i == '{' or i == '}' or i == ',' or (i == ' '):
			continue
		elif i not in ans.keys():
			ans[i] = 1
			count += 1
	print(count)
main()


string = input()
ls = list(string)
ls.remove('{')
ls.remove('}')
mylist = []
for i in ls:
	if i != ',' and i != ' ':
		mylist.append(i)
unique = []
for i in mylist:
	if i not in unique:
		unique.append(i)
print(len(unique))


write = input()
l = len(write)
word = write[1:l - 1]
if l < 3:
	print('0')
else:
	letters = word.split(', ')
	num = len(letters)
	list = sorted(letters)
	for i in range(1, num):
		if list[i] == list[i - 1]:
			num -= 1
	print(num)


a = list(set(input().strip('{}').split(',')))
b = [i.strip(' ') for i in a if i != '']
print(len(set(b)))


list1 = input()
list1 = list1[1:-1]
list1 = ''.join(list1.split(', '))
list1 = set(list1)
list1 = ''.join(list(list1))
print(len(list1))


x = input()
y = list(x)
n = len(y)
n_letters = int(n / 3)
n_comma = int((n - n_letters - 2) / 2)
for i in range(n_comma):
	y.remove(',')
	y.remove(' ')
y.remove('{')
y.remove('}')
y.sort()
count = 0
for j in range(len(y) - 1):
	if y[j] != y[j + 1]:
		count += 1
if len(y) == 0:
	print(0)
else:
	print(count + 1)


string = input()
if string == '{}':
	print(0)
else:
	string = string.replace('{', '')
	string = string.replace('}', '')
	string = string.split(', ')
	string = set(string)
	print(len(string))


import string
line = input()
lowercase = string.ascii_lowercase
a_set = set()
for x in line:
	if x in lowercase:
		a_set.add(x)
print(len(a_set))


s = input()
s = list(s)
answer = set()
for i in s:
	if i.isalpha():
		answer.add(i)
print(len(answer))


letList = []
notLetters = ['{', '}', ' ', ',']
a = 0
for let in input():
	if let in letList:
		continue
	else:
		letList.append(let)
		if let not in notLetters:
			a += 1
print(a)


line = input()
dict = {}
for i in range(len(line)):
	if line[i].isalpha():
		if not line[i] in dict:
			dict[line[i]] = 1
print(len(dict))


a = input()
a = a[1:-1]
if a == '':
	print(0)
else:
	a = a.split(', ')
	letters = set()
	for letter in a:
		letters.add(letter)
	print(len(letters))


s = input()
S = ''
for i in s:
	if i != ',' and i != '{' and (i != '}') and (i != ' '):
		S += i
S = set(S)
print(len(S))


s = input()
s1 = s[1:len(s) - 1]
s = s1.split(', ')
d = {}
for i in range(26):
	d[chr(97 + i)] = 0
d[''] = 1
k = 0
if len(s) > 0:
	for i in range(len(s)):
		if d[s[i]] == 0:
			k += 1
			d[s[i]] = 1
print(k)


def main():
	S = input().rstrip()[1:-1]
	ans = {i for i in S if i not in (',', ' ')}
	print(len(ans))
main()


s = input()
s = s.replace('{', '')
s = s.replace('}', '')
s = s.replace(' ', '')
s = s.replace(',', '')
s = set(s)
a = len(s)
print(a)


s = input()
if len(s) - 2 == 0:
	print(0)
else:
	print(len(set(s[1:-1].replace(' ', '').split(','))))


a = input()
if a == '{}':
	print(0)
else:
	a = a[0] + "' " + a[1:len(a) - 1] + "'" + '}'
	n = ''
	for i in range(len(a)):
		if a[i] == ',':
			n = n + "'" + ',' + "'"
		else:
			n += a[i]
	p = eval(n)
	print(len(p))


n = input()
a = 129 * [0]
for i in range(len(n)):
	a[ord(n[i])] += 1
m = 0
for i in range(97, 123):
	if a[i] > 0:
		m += 1
print(m)


n = list(input())
n.remove('{')
n.remove('}')
if n:
	n = ''.join(n)
	n = n.split(', ')
m = []
for i in n:
	if i not in m:
		m.append(i)
print(len(m))


inp = input()
box = inp.replace('{', '').replace('}', '').replace(',', '').split()
anton = len(set(box))
print(anton)


arr = input()
k = set()
for i in arr:
	if i.isalpha():
		k.add(i)
print(len(k))


s = list(str(input()))
ans = 0
taken = []
for i in s:
	if i != '{' and i != '}' and (i != ',') and (i != ' ') and (i not in taken):
		ans += 1
		taken.append(i)
print(ans)


def anton():
	x = input()
	count = 0
	chars = []
	for i in x:
		if i >= 'a' and i <= 'z':
			if i not in chars:
				count += 1
			chars.append(i)
	print(count)
anton()


counter = 1
inputstring = input()
if inputstring == '{}':
	print(0)
else:
	inputstring = inputstring[1:-1]
	letters = [i for i in inputstring.split(', ')]
	for i in range(len(letters) - 1):
		abra = 0
		for j in range(i + 1):
			if letters[i + 1] == letters[j]:
				abra += 1
		if abra == 0:
			counter += 1
	print(counter)


data = input()
str = data[1:-1].split()
dc = {}
for word in str:
	dc[word[0]] = 1
print(len(dc))


str1 = set(list(''.join(input()[1:-1].split(',')).split(' ')))
if '' in str1:
	print(len(str1) - 1)
else:
	print(len(str1))


l = input()
t1 = l.replace('{', '')
t2 = t1.replace('}', '')
t = t2.replace(', ', '')
ll = []
n = len(t)
for i in range(n):
	if t[i] not in ll:
		ll.append(t[i])
s = len(ll)
print(s)


i = input()
s = []
for c in i:
	if c != ',' and c != '{' and (c != '}') and (c != ' '):
		if not c in s:
			s.append(c)
print(len(s))


s = input()
s = s[1:-1]
l = list(s.split())
for x in range(len(l) - 1):
	l[x] = l[x][:-1]
print(len(set(l)))


a = input()
b = list(a)
d = 0
b = list(set(b))
if len(b) >= 4:
	b.remove(' ')
	b.remove(',')
	b.remove('{')
	b.remove('}')
	print(len(b))
elif len(b) == 3:
	b.remove('{')
	b.remove('}')
	print(len(b))
else:
	print(0)


set = input()
L = []
total = 0
for str in set:
	if 'a' <= str <= 'z':
		if str not in L:
			L.append(str)
			total = total + 1
print(total)


l = input()
if len(l) == 0:
	print(0)
	exit()
r = []
for i in l:
	if i == '{' or i == '}' or i == ',' or (i == ' '):
		pass
	else:
		r.append(i)
r = set(r)
print(len(r))


x = input()
x = x.replace('}', '')
x = x.replace('{', '')
x = x.replace(',', '')
x = x.split()
x = len(set(x))
print(x)


a = set(input())
ans = 0
for i in a:
	if i != ' ' and i != '{' and (i != '}') and (i != ','):
		ans += 1
print(ans)


def func():
	word = input()
	word = word[1:-1]
	word = word.split(', ')
	if word[0] == '':
		print('0')
		return
	s = set()
	for i in range(len(word)):
		s.add(word[i])
	print(len(s))
func()


n = input()
output = ''
if n != '{}':
	for i in n:
		if i != '{' and i != '}' and (i != ' ') and (i != ','):
			output += i
	output = list(set(output))
	print(len(output))
if n == '{}':
	print('0')


Input = input()
Input = Input.replace(',', '')
Input = Input.replace(' ', '')
Input = Input.replace('{', '')
Input = Input.replace('}', '')
output = len(Input)
strTemp = ''
for i in range(len(Input) - 1):
	if Input[i] not in strTemp:
		for j in range(i + 1, len(Input)):
			if Input[i] == Input[j]:
				output -= 1
				strTemp += Input[j]
print(output)


s = input()
a = set(s)
if len(a) > 3:
	print(len(a) - 4)
else:
	print(len(a) - 2)


s = input()
s1 = []
for i in range(0, len(s)):
	if s[i].isalpha():
		ch = s[i]
		s1.append(ch)
print(len(set(s1)))


ins = input()[1:-1]
if len(ins) == 0:
	print('0')
else:
	ins = ins.split(', ')
	print(len(set(ins)))


string = input().replace('}', '').replace('{', '').replace(' ', '').split(',')
if len(string) == 1 and string[0] == '':
	print('0')
else:
	print(len(set(string)))


inp = input().replace('{', '')
inp = inp.replace('}', '')
inp = inp.replace(',', '')
inp = set(inp.split())
print(len(inp))


test = [char for char in input()]
del test[0]
del test[-1]
ele = []
for i in range(len(test)):
	if i % 3 == 0:
		ele.append(test[i])
print(len(set(ele)))


s = input().strip('{').strip('}').replace(',', '').replace(' ', '')
l = []
for i in s:
	l.append(i)
print(len(set(l)))


s = input()
if s[1:-1] == '':
	print(0)
else:
	print(len(set(map(str.strip, s[1:-1].split(',')))))


s = input()
main = []
coo = ['}', '{', ',', ' ']
for i in s:
	if i in coo:
		pass
	else:
		main.append(i)
main = set(main)
print(len(main))


print(len(set([i for i in input() if ord('a') <= ord(i) <= ord('z')])))


c = input().strip('\\{\\}').split(', ')
if c[0] == '':
	print(0)
else:
	print(len(set(c)))


import sys
from math import sqrt
inp = sys.stdin.readline
read = lambda : list(map(int, inp().split()))

def solve():
	print(len(set(input() + ', ')) - 4)
solve()


import string
alpha = list(string.ascii_lowercase)
s = input()
uniq = set()
for i in range(0, len(s)):
	if s[i] in alpha:
		uniq.add(s[i])
print(len(uniq))


s = input().strip()
a = set()
for i in s:
	if i == '{':
		continue
	elif i == ',':
		continue
	elif i == '}':
		continue
	elif i == ' ':
		continue
	else:
		a.add(i)
print(len(a))


import re
n = input()
result = set(list(re.sub('[^a-zA-Z]', '', n)))
print(len(result))


K = list(map(str, input()))
S = set()
for i in K:
	if i.isalpha():
		S.add(i)
print(len(S))


s = input()
l1 = []
for i in s:
	if i == '{' or i == '}' or i == ',' or (i == ' '):
		pass
	else:
		l1.append(i)
print(len(set(l1)))


line = input()
if line == '{}':
	print(0)
	exit()
line = line[1:-1]
list1 = line.split(', ')
list2 = set(list1)
print(len(list2))


s = input()
s = s.replace('{', '')
s = s.replace('}', '')
s = s.replace(',', '')
s = s.replace(' ', '')
set1 = set(s)
print(len(set1))


n = input()
a = {}
if len(n) == 2:
	print(0)
elif len(n) == 3:
	print(1)
else:
	for i in n:
		if i not in a:
			a[i] = 1
	print(len(a) - 4)


print(len(set((c for c in input()[1:-1].split(', ') if c))))


b = input().lstrip('{').rstrip('}').strip(',').split(', ')
a = set(b)
li = set()
for j in b:
	if j not in li:
		li.update(j)
print(len(li))


line = input().lstrip('{').rstrip('}').split(',')
a = set([])
if not len(line) == 0:
	for i in range(len(line)):
		t = line[i].strip(' ')
		if t.isalpha():
			a.add(t)
print(len(a))


def main():
	line = input()
	letras = [x for x in line[1:len(line) - 1].split(', ')]
	if not letras[0]:
		print(0)
	else:
		print(distintos(letras))

def distintos(st):
	letras_st = []
	for char in st:
		if char not in letras_st:
			letras_st.append(char)
	return len(letras_st)
main()


a = input().strip('{}')
if a == '':
	print('0')
else:
	b = list(a.split(', '))
	print(len(set(b)))


the_set = input()
the_set = the_set.replace('{', '')
the_set = the_set.replace('}', '')
the_set = the_set.replace(',', '')
he_wrote = the_set.split()
print(len(set(he_wrote)))


inp = input()
inp = inp[1:]
inp = inp[:-1]
if len(inp) >= 1:
	inp = inp.split(', ')
	print(len(set(inp)))
elif len(inp) == 0:
	print(0)


s = input()
a = 26 * [0]
for i in range(len(s)):
	if 97 <= ord(s[i]) <= 122:
		a[ord(s[i]) - 97] += 1
s = 0
for i in range(26):
	if a[i] != 0:
		s += 1
print(s)


s = input()
a = []
for i in s:
	if i in 'abcdefghijklmnopqrstuvwxyz':
		a.append(i)
x = set(a)
print(len(x))


n = input()
a = []
i = 1
if len(n) == 2:
	print(0)
else:
	while i < len(n):
		a.append(n[i])
		i += 3
	print(len(list(set(a))))


n = input()
l = list(n)
l.remove(l[0])
l.remove(l[-1])
s = set(l)
if ',' in s:
	s.remove(',')
if ' ' in s:
	s.remove(' ')
print(len(s))


x = input()
array = [0] * 26
for i in range(len(x)):
	if ord(x[i]) >= 97 and ord(x[i]) <= 122:
		array[ord(x[i]) - 97] += 1
count = 0
for i in array:
	if i != 0:
		count += 1
print(count)


string = input()[1:-1]
print(0 if not string else len(set(string.split(', '))))


n = input().split(',')
lista = []
for i in n:
	for j in i:
		if j != '{' or '}':
			lista.append(j)
lista.remove('{')
lista.remove('}')
for i in lista:
	if i == ' ':
		lista.remove(i)
ser = set(lista)
print(len(ser))


s = input()
if len(s) == 2:
	print(0)
else:
	s = s[1:-1].split(', ')
	seting = list(set(s))
	print(len(seting))


set_letters = input().strip('{}').split(',')
distinct_letters = dict()
for each_char in set_letters:
	letter = each_char.strip(' ')
	if letter == '':
		continue
	else:
		distinct_letters[letter] = distinct_letters.get(letter, 0) + 1
print(len(distinct_letters.keys()))


chars = list(input())
print(len(set(chars) - set(['}', '{', ' ', ','])))


n = input()
if len(n) == 2:
	print('0')
else:
	a = 0
	fp = [0] * 26
	for i in range(1, len(n), 3):
		num = ord(n[i]) - 97
		fp[num] = 1
	for t in range(26):
		a += fp[t]
	print(a)


import re
str = input()
x = re.findall('[a-z]', str)
a = {}
for i in x:
	a[i] = 1
print(len(a))


a = input()[1:-1]
a = a.split(', ')
if '' in a:
	a.remove('')
a = set(a)
print(len(a))


letters = input()
result = list()
for i in letters:
	if i == ' ' or i == ',' or i == '{' or (i == '}'):
		continue
	else:
		result.append(i)
print(len(set(result)))


n = input()
l = list(map(str, str(n)))
l.remove('{')
l.remove('}')
k = []
if len(l) == 1:
	print(1)
elif len(l) != 0:
	for i in l:
		if i not in k:
			k.append(i)
	print(len(k) - 2)
else:
	print(0)


s = input()
flag = 0
if len(s) - 1 == 1:
	flag = 1
s = s[1:len(s) - 1].split(', ')
a = set(s)
print(len(a) if flag == 0 else '0')


print(len([i for i in list(set(input().replace('{', '').replace('}', '').split(', '))) if i != '']))


strA = input()
listA = [x for x in strA]
listA.pop()
listA.pop(0)
listA = listA[::3]
listB = []
for i in range(97, 123):
	listB.append(chr(i))
num = 0
for i in listA:
	if i in listB:
		num += 1
		listB.remove(i)
print(num)


value = input()
value = value[1:len(value) - 1]
value = set(value)
c = 0
for i in value:
	if i == ',' or i == ', ' or i == ' ':
		pass
	else:
		c = c + 1
print(c)


a = input()
b = set(a)
c = len(b)
if a == '{a}' or a == '{b}' or a == '{c}' or (a == '{d}') or (a == '{e}') or (a == '{f}') or (a == '{g}') or (a == '{h}') or (a == '{i}') or (a == '{j}') or (a == '{k}') or (a == '{l}') or (a == '{m}') or (a == '{n}') or (a == '{o}') or (a == '{p}') or (a == '{q}') or (a == '{r}') or (a == '{s}') or (a == '{t}') or (a == '{u}') or (a == '{v}') or (a == '{w}') or (a == '{x}') or (a == '{y}') or (a == '{z}'):
	print(1)
elif a == '{}':
	print(c - 2)
else:
	print(c - 4)


anton_set = input()[1:-1].split(', ')
characters = []
for letter in anton_set:
	if letter not in characters and letter != '':
		characters.append(letter)
print(len(characters))


a = input()
c = 1
a = a.replace('{', '')
a = a.replace(',', '')
a = a.replace('}', '')
a = a.replace(' ', '')
a = list(a)
a.sort()
a = ''.join(a)
if len(a) == 0:
	print('0')
else:
	for i in range(len(a) - 1):
		if a[i] < a[i + 1]:
			c += 1
	print(c)


n = input()
n = n.split(', ')
n = ''.join(n)
n = list(n)
print(len(set(n)) - 2)


n = input()
k = len
if k(n) == 2 or k(n) == 3:
	print(k(n) - 2)
else:
	print(k(set(n)) - 4)


s = list(input())
l1 = set()
c = 0
r = 0
for item in s:
	if item == '{' or item == '}' or item == ',' or (item == ' '):
		continue
	l1.add(item)
for i in l1:
	c += 1
print(c)


from collections import OrderedDict
sti = input()
mti = sti.replace('{', '')
nti = mti.replace('}', '')
ati = nti.replace(',', '')
cti = ati.replace(' ', '')
rti = ''.join(set(cti))
s = len(rti)
print(s)


x = input()
x = x.replace('{', '')
x = x.replace('}', '')
x = x.replace(',', '')
print(len(list(dict.fromkeys(x.split()))))


n = str(input())
c = []
for i in range(len(n)):
	if ord(n[i]) >= 65 and ord(n[i]) <= 90 or (ord(n[i]) >= 97 and ord(n[i]) <= 122):
		c.append(n[i])
ans = set(c)
print(len(ans))


s = input()
j = 1
c = 0
while j < len(s) - 1:
	if s[1:j].count(s[j]) == 0:
		c += 1
	j += 3
print(c)


a = input().strip('{}').replace(' ', '').split(',')
if a == ['']:
	b = 0
else:
	b = len(set(a))
print(b)


l = input()
result = []
for i in range(100):
	result.append(0)
for i in range(len(l)):
	if l[i] == ',' or l[i] == '{' or l[i] == '})':
		continue
	else:
		result[ord(l[i]) - ord('a')] += 1
sum = 0
for i in range(26):
	if result[i] != 0:
		sum += 1
print(sum)


a = input()
m = []
for i in a:
	if ord(i) > 96 and ord(i) < 123:
		m.append(i)
x = set(m)
print(len(x))


z = input().replace('{', '').replace('}', '').split(', ')
if z != ['']:
	print(len(set(z)))
else:
	print(0)


SET = set()
l = []
x = input()
a = len(x)
if a == 2:
	print('0')
else:
	l = x[1:a - 1].split(', ')
	x = len(l)
	for i in range(0, x):
		SET.add(l[i])
	print(len(SET))


se = []
n = 0
for x in input()[1:-1].split(', '):
	if x == '':
		break
	elif not x in se:
		se.append(x)
		n += 1
print(n)


alpha = set(str(input())[1:-1:3])
print(len(alpha))


import collections
from collections import OrderedDict
str1 = input()
s = str1.replace(' ', '').replace(',', '').replace('{', '').replace('}', '')
res = ''.join(sorted(s))
p = ''
p = p + str(res)
t = ''.join(OrderedDict.fromkeys(p))
c = 0
for i in range(0, len(t)):
	c = c + 1
print(c)


set1 = input()
set1 = list(set1)
set2 = []
set3 = []
for i in set1:
	if i.isalpha() == True:
		set2.append(i)
for i in set2:
	if i not in set3:
		set3.append(i)
print(len(set3))


s1 = {i for i in input()}
t = len(s1) - 4
if t == -1:
	print(1)
elif t < 0:
	print(0)
else:
	print(t)


s = input()
n = len(s)
li = []
for i in range(n):
	if s[i] not in li:
		li.append(s[i])
str = [str(elem) for elem in li]
b = ''.join(str)
x = len(b)
c = 0
for i in range(x):
	if b[i] <= 'z' and b[i] >= 'A':
		c += 1
print(c)


a = input()
b = a.split(', ')
b[0] = b[0].lstrip('{')
b[-1] = b[-1].rstrip('}')
n = 0
for i in ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']:
	if i in b:
		n = n + 1
print(n)


counter = 0
letters = input()
letters_list = list(letters)
numbers_list = []
for i in letters_list:
	x = ord(i)
	if x >= 97 and x <= 122:
		numbers_list.append(x)
if len(numbers_list) == 0:
	print(counter)
	exit()
n = len(numbers_list) - 1
for i in range(len(numbers_list) - 1):
	for i in range(n):
		if numbers_list[i] > numbers_list[i + 1]:
			holder = numbers_list[i]
			numbers_list[i] = numbers_list[i + 1]
			numbers_list[i + 1] = holder
	n -= 1
for i in range(0, len(numbers_list) - 1):
	if numbers_list[i] != numbers_list[i + 1]:
		counter += 1
print(counter + 1)


sets = input()
lists = []
for i in range(len(sets)):
	if sets[i] not in lists and sets[i] != '{' and (sets[i] != '}') and (sets[i] != ',') and (sets[i] != ' '):
		lists.append(sets[i])
print(len(lists))


string = input()
string = string.replace('{', '')
string = string.replace('}', '')
string = string.replace(', ', '')
print(len(set(string)))


import sys
x = input()
x = x.replace('{', '')
x = x.replace(',', '')
x = x.replace('}', '')
x = x.replace(' ', '')
d = int(len(set(x)))
print(int(d))


i = input()
print(0 if len(i) == 2 else len(set(i[1:-1].split(', '))))


n = input()
count = 0
for i in range(len(n)):
	if count == 26:
		break
	if n[i] >= 'a' and n[i] <= 'z':
		count += 1
		n = n.replace(n[i], ' ')
print(count)


a = input()
n = 0
newa = a
if len(a) > 2:
	while len(newa) > 3:
		s = newa[1] + ', '
		newa = newa.replace(s, '')
		n += 1
	b = newa[1]
	if a.count(b) > 1:
		pass
	else:
		n += 1
else:
	pass
print(n)


x = input()
x = list(x)
try:
	x.remove('{')
	x.remove('}')
except:
	pass
p = set(x)
try:
	p.remove(' ')
	p.remove(',')
except:
	pass
print(len(p))


print(len({c for c in input() if c in 'abcdefghijklmnopqrstuvwxyz'}))


a = list(map(str, input()))
b = set()
for i in a:
	if i.isalpha():
		b.add(i)
print(len(b))


n = input()
l = []
c = 0
for i in n:
	if i.isalpha():
		l.append(i)
l = set(l)
for j in l:
	c += 1
print(c)


string = input()
string = string.replace(' ', '')
list2 = []
list1 = string[1:-1].split(',')
for i in range(len(list1)):
	if list1[i] not in list2:
		list2.append(list1[i])
	else:
		continue
if list2[0] == '':
	print(0)
else:
	print(len(list2))


s = input()[1:-1] + ', '
p = set(map(str.strip, s.split(',')))
print(len(p) - 1)


inputString = input()
splitString = list(inputString)
if len(splitString) == 2:
	print(0)
else:
	splitString = splitString[1::3]
	splitString = set(splitString)
	print(len(splitString))


ans = [i for i in input() if ord(i) > 92 and ord(i) < 123]
ans = list(set(ans))
print(len(ans))


values = input()[1:-1]
if values:
	letters = values.split(', ')
	result = []
	for letter in letters:
		if letter not in result:
			result.append(letter)
	print(len(result))
else:
	print(0)


s = input()
p = set()
a = 1
while True:
	if a > len(s) - 2:
		break
	m = set(s[a])
	p = p | m
	a += 3
print(len(p))


string = input()
array = []
for x in range(1, 27):
	array.append(False)
a = string.rstrip('}')
b = a.lstrip('{')
c = b.split(', ')
if c.__contains__(''):
	print(0)
else:
	for x in c:
		array[ord(x) - ord('a')] = True
	count = 0
	for x in array:
		if x == True:
			count = count + 1
	print(count)


x = input()
y = x[1:len(x) - 1]
z = y.split(', ')
r = set(z)
if r == {''}:
	print('0')
else:
	print(len(r))


set = list(''.join(list(input().split(','))))[1:-1]
present = {}
for i in range(97, 123):
	present[chr(i)] = 0
for letter in set:
	present[letter] = 1
distinct = 0
for i in range(97, 123):
	if present[chr(i)]:
		distinct += 1
print(distinct)


s = input()
a = list(s)
a.pop(0)
del a[-1]
if len(a):
	s = ''.join(a)
	a = s.split()
	s = ''.join(a)
	a = s.split(',')
	s = set(a)
	print(len(s))
else:
	print(0)


g = input()
nums = []
letters = 'abcdefghijklmnopqrstuvwxyz'
for i in g:
	if i in letters:
		nums.append(i)
Mxn = set(nums)
print(len(Mxn))


def countdistint(str):
	count = 0
	l = [i for i in str]
	x = []
	if len(l) == 1:
		return 1
	for i in range(len(l)):
		for j in range(len(l)):
			if i != j:
				if l[i] != [j] and l[i] not in x:
					count += 1
					x.append(l[i])
	return abs(count)

def removebk(str):
	newstr = str[1:len(str) - 1]
	return newstr

def r_com(str):
	n_str = ''
	for e in str:
		if e != ',' and e != ' ':
			n_str = n_str + e
	return n_str
stri = input()
print(countdistint(r_com(removebk(stri))))


z = set(input())
if ',' in z:
	z.remove(',')
if ' ' in z:
	z.remove(' ')
z.remove('{')
z.remove('}')
a = len(z)
print(a)


s = str(input())
count = 0
c = []
x = ord('a')
y = ord('z')
for i in range(len(s)):
	if x <= ord(s[i]) <= y and s[i] not in c:
		c.append(s[i])
		count += 1
print(count)


a = input()
let = []
for _ in range(26):
	let.append(0)
ans = 0
for i in a[1:-1:3]:
	if let[ord(i) - 97] == 0:
		ans += 1
		let[ord(i) - 97] += 1
print(ans)


dict = {}
letters = 'abcdefghijklmnopqrstuvwxyz'
str = input()
for i in str:
	if i in letters:
		dict[i] = 1
print(len(dict))


_str = input()
_dat = dict()
__str = str()
for i in _str:
	if i != ' ':
		__str += i
for i in list(__str[1:-1].split(',')):
	if i != '':
		_dat[i] = 1
print(len(_dat))


import re
l = input()
m = re.split(', |{|}', l)
new = list(set(m))
print(len(new) - 1)


s = input()
mylist = []
for i in range(len(s)):
	if s[i].isalpha():
		mylist.append(s[i])
a = set(mylist)
print(len(a))


s = list(input().lstrip('{').rstrip('}').split(', '))
if s == ['']:
	print('0')
	exit()
d = list()
for i in s:
	if i not in d:
		d.append(i)
print(len(d))


from collections import defaultdict
s = input()
n = len(s)
d = defaultdict(int)
for i in s:
	if i == '{' or i == '}' or i == ' ' or (i == ','):
		continue
	else:
		d[i] += 1
print(len(d))


raw = str(input())
line = []
for i in range(int(len(raw) / 3)):
	line.append(raw[3 * i + 1])
line1 = set(line)
print(len(line1))


a = input().replace(' ', '')
s = '{},'
c = 0
for i in a:
	if i not in s:
		s += i
		c += 1
print(c)


test = input().split()
test[0] = test[0][1]
count = 0
if test[0] == '}':
	print(0)
else:
	for i in range(1, len(test)):
		test[i] = test[i][0]
	letters = []
	for i in range(len(test)):
		if test[i] not in letters:
			letters.append(test[i])
			count += 1
	print(count)


a = str(input())
n = len(a)
l = []
for j in range(256):
	l.append(0)
for i in range(n):
	if 'a' <= a[i] <= 'z':
		c = ord(a[i])
		l[c] = 1
num = sum(l)
print(num)


data = input()
if data == '{}':
	print(0)
else:
	data = data.replace('{', '')
	data = data.replace('}', '')
	data = data.split(', ')
	data = set(data)
	print(len(data))


sett = input()
cnt = 0
letters = []
for i in range(1, len(sett), 3):
	letters.append(sett[i])
	letters.sort()
for m in range(len(letters) - 1):
	if letters[m] is not letters[m + 1]:
		cnt += 1
if len(sett) <= 2:
	cnt = 0
else:
	cnt += 1
print(cnt)


letters = list(map(str, input()))
st = set()
for i in letters:
	if i.isalpha():
		st.add(i)
print(len(st))


a = input()
if a == '{}':
	print(0)
	exit(0)
print(len(list(set(a[1:len(a) - 1].split(', ')))))


x = ''.join(list((x for x in input().split(','))))
z = x.strip('{}')
print(len(set(z.split())))


s = input()
alpha = []
for i in s:
	if i.isalpha():
		alpha.append(i)
distinct = set(alpha)
print(len(distinct))


letter = input()
alphabets = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
letter = list(filter(lambda x: x in alphabets, letter))
print(len(set(letter)))


str1 = input()
if str1 == '{}':
	print(0)
else:
	str1 = str1[1:-1]
	list1 = str1.split(', ')
	set1 = set(list1)
	n = len(set1)
	print(n)


s = input().strip('{|}').split(', ')
print(len(set(s)) - 1 * (set(s) == {''}))


a = input()
new = []
for i in a:
	if i.isalpha():
		new.append(i)
print(len(set(new)))


a = input()
b = list(set(a))
c = []
for i in range(len(b)):
	if b[i].isalpha() == True:
		c.append(b[i])
print(len(c))


s = input().split('{')[1].split('}')[0]
l1 = []
for i in s:
	p = ord(i)
	if 97 <= p <= 122 and i not in l1:
		l1.append(i)
print(len(l1))


n = set(input())
s = 0
for i in n:
	if i.isalpha():
		s += 1
print(s)


n = input().strip(',')
g = list(n)
g.sort()
cnt = 0
for i in range(len(g)):
	if g[i] != '{' and g[i] != '}' and (g[i] != ',') and (g[i] != ' '):
		if g[i] != g[i - 1]:
			cnt += 1
print(cnt)


letters = input()
letters = [x for x in letters]
letters.remove('{')
letters.remove('}')
while ',' in letters:
	letters.remove(',')
while ' ' in letters:
	letters.remove(' ')
rep = []
count = 0
for i in letters:
	if i in rep:
		continue
	rep.append(i)
	count += 1
print(count)


score = input()
if len(score[1:-1]) == 0:
	print(0)
else:
	print(len(set(score[1:-1].split(', '))))


n = input()
s = n[1:len(n) - 1]
i = 0
l = list()
while i < len(s):
	l.append(s[i])
	i += 3
print(len(set(l)))


string = input()
s = set()
for i in range(len(string)):
	if string[i] not in ', {}' and string[i] not in s:
		s.add(string[i])
print(len(s))


n = input().lstrip('{').rstrip('}')
if n == '':
	print(0)
else:
	m = n.split(', ')
	print(len(set(m)))


a = input()
a = a.replace('{', '')
a = a.replace('}', '')
while True:
	i_1 = a.find(',')
	i_2 = a.find(' ')
	a = a.replace(',', '')
	a = a.replace(' ', '')
	if i_1 == -1:
		break
s = set()
for i in a:
	s.update(i)
print(len(s))


s = input().lstrip('{').rstrip('}').split(', ')
flag = [0] * 26
count = 0
if len(s) == 0 or s[0] == '':
	print(0)
else:
	for letter in s:
		if flag[ord(letter) - ord('a')] == 0:
			count += 1
			flag[ord(letter) - ord('a')] = 1
	print(count)


ls = [i for i in input().split(', ')]
ls[0] = ls[0][1]
ls[-1] = ls[-1][0]
dis = []
for i in ls:
	if i not in dis:
		dis.append(i)
if ls[0] == '}':
	print(0)
else:
	print(len(dis))


text = input()
letters = set()
for x in text:
	if x != ' ' and x != '{' and (x != '}') and (x != ','):
		letters.add(x)
print(len(letters))


line = list(str(input()))
n = len(line)
k = []
for i in range(1, n - 1, 3):
	k.append(line[i])
newk = set(k)
print(len(newk))


s = str(input())
if len(s) == 2:
	print(0)
	quit()
s = s[1:len(s) - 1]
l = s.split(sep=', ')
l_set = set(l)
print(len(l_set))


import re
print(len(set(re.sub('[{},]', '', input()).split())))


a = input()
l = []
s = 0
for i in range(0, len(a)):
	if a[i] != '{' and a[i] != '}' and (a[i] != ',') and (a[i] != ' '):
		l.append(a[i])
		s = s + 1
p = sorted(l)
re = 0
x = 97
for j in range(0, s):
	if ord(p[j]) in range(x, 123):
		re = re + 1
		x = x + (ord(p[j]) - x) + 1
print(re)


n = str(input())
s = []
for i in n:
	if ord(i) >= 97 and ord(i) < 123:
		s.append(i)
print(len(set(s)))


inp = list(input())
inp.remove('{')
inp.remove('}')
while True:
	if ',' in inp:
		inp.remove(',')
		inp.remove(' ')
	if not ',' in inp:
		break
l = len(inp)
w = 0
list1 = []
for i in range(l):
	if inp[i] not in list1:
		w += 1
		list1.append(inp[i])
print(w)


s = input()
l = 'abcdefghijklmnopqrstuvwxyz'
t = 0
k = 0
while t <= 25:
	if l[t] in s:
		k = k + 1
	else:
		k = k
	t = t + 1
print(k)


string = list(map(str, input()))
letters = 'abcdefghijklmnopqrstuvwxyz'
res = 0
for i in letters:
	if i in string:
		res += 1
print(res)


n = input()
s = ''
for i in n:
	if i != ' ' and i != ',' and (i != '{') and (i != '}') and (i not in s):
		s += i
print(len(s))


s = input()
i = 1
l = []
while i < len(s):
	if ord(s[i]) >= 97 and ord(s[i]) <= 123:
		l.append(s[i])
	i += 3
print(len(set(l)))


s = input()
li = []
for i in s:
	if i.isalpha():
		li.append(i)
li.sort()
count = 0
if len(li) != 0:
	count = 1
	for i in range(1, len(li)):
		if li[i] != li[i - 1]:
			count += 1
print(count)


L = [k.lower() for k in input() if k != '{' and k != ' ' and (k != '}') and (k != ',')]
L = list(set(L))
print(len(L))


alpha = input()
set_ = {}
set_ = set()
for i in alpha:
	if i == '{':
		continue
	elif i == '}':
		continue
	elif i == ',':
		continue
	elif i == ' ':
		continue
	else:
		set_.add(i)
print(len(set_))


letters_input = input().strip('{}').split(',')
letters = len(set((letter.strip() for letter in letters_input if len(letter) > 0)))
print(letters)


char = input()
n = len(char)
letters = []
for i in range(n):
	letters.append(char[i])
letters.remove('{')
letters.remove('}')
letters = set(letters)
if ' ' in letters:
	letters.remove(' ')
if ',' in letters:
	letters.remove(',')
print(len(letters))


l = set(input())
print(len(set((c for c in l if c.isalpha()))))


letters = input().split(', ')
letters[0] = letters[0][1:]
letters[len(letters) - 1] = letters[len(letters) - 1][:len(letters[len(letters) - 1]) - 1]
if letters[0] == '':
	print(0)
	quit()
print(len(set(letters)))


s = input()
s = s.split(', ')
s = ''.join(s)
s = s[1:-1]
print(len(set(s)))


array = []
frase = input()
for i in frase:
	if i == '{' or i == ' ' or i == '}' or (i == ','):
		pass
	else:
		array.append(i)
clear = set(array)
result = 0
for j in clear:
	if array == []:
		print('0 0')
		break
	else:
		result = result + 1
print(result)


n = input()
a = []
s = []
y = len(n)
count = 0
for i in range(1, y, 3):
	a.append(n[i])
for i in range(len(a)):
	if a[i] not in s:
		s.append(a[i])
if n == '{}':
	print(0)
else:
	print(len(s))


s = input()
l = s[1:-1].split(',')
if l[0] == '':
	print(0)
else:
	x = []
	for i in l:
		a = i.strip()
		x.append(a)
	print(len(set(x)))


s = input()
s = s[1:-1]
res = len(s)
if res > 0:
	x = s.split(', ')
	print(len(set(x)))
else:
	print(0)


text = ''
for a in str(input()):
	if a.islower() and a not in text:
		text += a
print(len(text))


import re
s = input()
l = re.findall('[a-z]', s)
print(len(set(l)))


s = list(set(input()))
alp = 'abcdefghijklmnopqrstuvwxyz'
cnt = 0
for i in s:
	if i in alp:
		cnt += 1
print(cnt)


x = input()
ar = []
for i in x:
	if i != ',' and i != '{' and (i != '}') and (i != ' '):
		if i not in ar:
			ar.append(i)
print(len(ar))


s = list(input())
for i in range(len(s)):
	if s[i] in ('{', '}', ',', ' '):
		s[i] = ''
s = set(s)
print(len(s) - 1)


s = input()[1:-1]
l = set([x for x in s[0::3]])
print(len(l))


input_str = input()
if input_str != '{}':
	lst = [i for i in input_str[1:len(input_str) - 1].split(', ')]
	print(len(set(lst)))
else:
	print('0')


sets = input()
li = []
for i in range(len(sets)):
	if sets[i].isalpha():
		li.append(sets[i])
print(len(set(li)))


s = input()[1:-1].split(', ')
try:
	s = set(s)
	s = s.remove('')
except KeyError as e:
	pass
print(len(s) if s != None else 0)


import math
a = set()
n = input()
for i in range(len(n)):
	if n[i].isalpha():
		a.add(n[i])
print(len(a))


import re

def main():
	st = input()
	st = st[1:]
	st = st[:-1]
	st = re.sub('[,]', '', st)
	stList = st.split()
	stList = list(dict.fromkeys(stList))
	l = len(stList)
	print(l)
main()


s = input()
setLetters = set(s.replace(', ', '')[1:-1])
print(len(setLetters))


string = str(input()).replace(',', '').replace('}', '').replace('{', '').replace(' ', '')
k = ''
for elem in string:
	if elem in k:
		continue
	k += elem
print(len(k))


alphabet = list(input())
num = 0
for letter in alphabet:
	if ord(letter) >= 65 and ord(letter) <= 122:
		num += 1
		while alphabet.count(letter) > 0:
			alphabet.remove(letter)
print(num)


s = input()
s = s.strip('{')
s = s.strip('}')
s = s.split(', ')
print('%d' % (0 if s == [''] else len(set(s))))


s = input()
arr = s[1:len(s) - 1].split(', ')
if arr[0] == '':
	print(0)
else:
	l = set(arr)
	print(len(l))


letras = input()
letras = letras.split(', ')
if letras == ['{}']:
	print(0)
else:
	letras[0] = letras[0][1]
	letras[len(letras) - 1] = letras[len(letras) - 1][0]
	lista_final = []
	for i in letras:
		if i not in lista_final:
			lista_final.append(i)
	print(len(lista_final))


letters = list(filter(lambda a: a != ' ' and a != ',', input()[1:-1]))
print(len(set(letters)))


s = input()
l = len(s)
l1 = []
for i in range(l):
	if s[i].isalpha():
		l1.append(s[i])
l2 = set(l1)
print(len(list(l2)))


x = input()
z = []
c = 1
if x == '{}':
	print('0')
else:
	for i in x:
		if i == ',' or i == '{' or i == '}' or (i == ' '):
			continue
		else:
			z.append(i)
	z = sorted(z)
	for i in range(len(z) - 1):
		if z[i] != z[i + 1]:
			c = c + 1
	print(c)


c = 0
a = set(map(str, input()))
for i in a:
	if i.isalpha() == True:
		c += 1
print(c)


from collections import deque
from collections import Counter
from itertools import permutations
import heapq

def counterExample():
	arr = [1, 3, 4, 1, 2, 1, 1, 3, 4, 3, 5, 1, 2, 5, 3, 4, 5]
	counter = Counter(arr)
	top_three = counter.most_common(3)
	print(top_three)
q = deque()

def main():
	string = input()
	newString = string[1:-1]
	letters = newString.replace(' ', '').split(',')
	d = {}
	for letter in letters:
		if letter not in d and letter >= 'a' and (letter <= 'z'):
			d[letter] = 1
	print(len(d.keys()))
main()


s = input()
alphabets = 'abcdefghijklmnopqrstuvwxyz'
result = 0
for i in alphabets:
	if i in s:
		result = result + 1
print(result)


set = input()
tab = []
for i in set:
	if i != '{' and i != '}' and (i != ' ') and (i != ',') and (i not in tab):
		tab.append(i)
print(len(tab))


X = list(input())
X.append(',')
X.append(' ')
print(len(set(X)) - 4)


a = input()
for i in 'abcdefghijklmnopqrstuvwxyz':
	if i in a:
		a = a.replace(i, "'" + i + "'")
print(len(eval(a)))


line = input().lstrip('{').rstrip('}')
if line == '':
	print(0)
else:
	line = line.split()
	list = []
	for i in range(len(line) - 1):
		list.append(line[i].rstrip(','))
	list.append(line[-1])
	List = sorted(list)
	List.append('0')
	counter = 0
	for i in range(len(List) - 1):
		if List[i] == List[i + 1]:
			pass
		else:
			counter += 1
	print(counter)


import sys
input = sys.stdin.readline

def main():
	s = input().strip()
	if s == '{}':
		print(0)
		return
	s = set(s[1:-1].split(', '))
	print(len(s))
main()


s = list(input())
c = set()
for i in s:
	if i != ' ' and i != '}' and (i != '{') and (i != ','):
		c.add(i)
print(len(c))


import string
from array import *
str = string
str = input()
lis = ['']
for i in range(1, len(str)):
	if i < len(str) - 1 and str[i] != ',' and (str[i] != ' '):
		z = str[i]
		lis.append(z)
lis = list(dict.fromkeys(lis))
print(len(lis) - 1)


alfabeto = {'a': 0, 'b': 0, 'c': 0, 'd': 0, 'e': 0, 'f': 0, 'g': 0, 'h': 0, 'i': 0, 'j': 0, 'k': 0, 'l': 0, 'm': 0, 'n': 0, 'o': 0, 'p': 0, 'q': 0, 'r': 0, 's': 0, 't': 0, 'u': 0, 'v': 0, 'w': 0, 'x': 0, 'y': 0, 'z': 0}
count = 0
string = input()
lista = string.split(',')
for i in range(len(lista)):
	lista[i] = lista[i].replace('{', '').replace('}', '').replace(' ', '')
	if lista[i] != '':
		alfabeto[lista[i]] += 1
		if alfabeto[lista[i]] == 1:
			count += 1
print(count)


n = input().strip('{}')
x = n.replace(', ', '')
print(len(set(x)))


from decimal import Decimal
import math
from collections import Counter
l1 = input()
l1 = l1.replace('{', '')
l1 = l1.replace('}', '')
l1 = l1.replace(',', '')
l1 = l1.split()
x = Counter(l1).keys()
print(len(x))


AntonSet = input()
DistinctLetters = 0
AntonSet = AntonSet.replace(' ', '')
AntonSet = AntonSet.replace(',', '')
while AntonSet != '':
	AntonSet = AntonSet.replace(AntonSet[0], '')
	DistinctLetters += 1
print(DistinctLetters - 2)


patt = 'qwertyuiopasdfghjklzxcvbnm'
string = input()
zzz = {'@': 0}
for i in string:
	if i in patt:
		zzz[i] = 1
answer = -1
for i in zzz:
	answer += 1
print(answer)


A = input()
B = []
for i in A:
	B.append(i)
B = set(B)
if len(B) > 3:
	print(len(B) - 4)
else:
	print(len(B) - 2)


x = input()
d = set()
for i in range(len(x)):
	if ord(x[i]) > 95 and ord(x[i]) < 123:
		d.add(x[i])
print(len(d))


S = input()
l = {S[i] for i in range(len(S))}
if len(l) == 2:
	print(0)
elif len(l) == 3:
	print(1)
else:
	print(len(l) - 4)


a = input()[1:-1].split(', ')
s = 0
for i in range(len(a)):
	if a[i] not in a[0:i] and a[i] != '':
		s += 1
print(s)


from collections import Counter
a = input()
l = []
for i in a[1:len(a) - 1]:
	if i.isalpha():
		l.append(i)
key = list(dict(Counter(l)).keys())
print(len(key))


s = input()
x = []
n = 0
for i in range(len(s)):
	if s[i] == '{' or s[i] == '}' or s[i] in x or (s[i] == ' ') or (s[i] == ','):
		continue
	else:
		n += 1
		x.append(s[i])
print(n)


s = input()
c = 0
sett = set()
for i in s:
	k = ord(i)
	if k < 91 and k >= 65 or (k >= 96 and k <= 122):
		sett.add(i)
print(len(sett))


line = input()
total = []
for x in line:
	if x.isalpha():
		total += [x]
total = list(set(total))
letters = len(total)
print(letters)


def solve(txt):
	return len(set([t.strip() for t in txt[1:-1].split(',') if t.strip()]))

def main():
	txt = input()
	print(solve(txt))
main()


s = input()
a = []
for c in s:
	if c.islower():
		a.append(c)
print(len(set(a)))


s = input('')[1:-1].replace(',', '').split(' ')
if '' in s:
	s.remove('')
print(len(set(s)))


n = input()
(a, s) = ([], '')
for i in n:
	a.append(i)
for i in range(len(a)):
	for j in range(len(a)):
		if a[i] == ',' or a[i] == ' ':
			a[i] = ''
		if i != j and a[i] == a[j]:
			a[i] = ''
for i in a:
	s = s + i
print(len(s) - 2)


letters = [i for i in input().strip('{').strip('}').split(', ')]
if letters.count('') != 0:
	letters.remove('')
result = set(letters)
print(len(result))


n = list(input())
if n == list('{}'):
	print(0)
	exit()
l = [',', ' ', '{', '}']
for i in n:
	if i in l:
		n.remove(i)
n = list(set(n))
for i in n:
	if i == ' ':
		n.remove(i)
print(len(n))


inp = input()
n = len(inp)
l = [0] * n
for i in range(int(n / 3)):
	l[i] = inp[1 + 3 * i]
result = []
for i in l:
	if i not in result:
		result.append(i)
ans = len(result)
print(ans - 1)


s = input()
unique = set()
if len(s) != 2:
	for i in range(1, len(s), 3):
		unique.add(s[i])
	print(len(unique))
else:
	print(0)


inp = input()
inp = inp.replace('{', '').replace('}', '').replace(',', '')
inp = set(inp.split(' '))
if '' in inp:
	inp.remove('')
print(0 if inp is None else len(inp))


l = {x for x in input()[1:-1:3]}
print(len(l))


open = input()
open = set(open)
if ',' in open:
	open.remove(',')
if ' ' in open:
	open.remove(' ')
open.remove('}')
open.remove('{')
print(len(open))


lst = input().split(', ')
lst = [x.replace('{', '') for x in lst]
lst = [x.replace('}', '') for x in lst]
s = set(lst)
if '' in s:
	print(0)
else:
	print(len(s))


x = input()
y = set()
for i in x:
	if ord(i) >= 97 and ord(i) <= 122:
		y.add(i)
print(len(y))


import re
print(len(set(re.findall('[\\S]*', input().replace('{', '').replace('}', '').replace(',', '')))) - 1)


s = input()
s = s.replace('{', '')
s = s.replace('}', '')
s = s.replace(',', '')
x = set(s)
c = 0
for i in x:
	if i != ' ':
		c += 1
print(c)


l = list(input())
d = []
for i in l:
	if i not in d and i.isalpha():
		d.append(i)
print(len(d))


n = input().strip()
for i in n:
	if i == '{':
		n = n.replace('{', '')
	elif i == ',':
		n = n.replace(',', '')
	elif i == '}':
		n = n.replace('}', '')
	elif i == ' ':
		n = n.replace(' ', '')
n = list(n)
print(len(set(n)))


ch = input()
ens = set()
for e in ch:
	if e <= 'z' and e >= 'a':
		ens.add(e)
print(len(ens))


s = list(input())
p = []
for i in range(1, len(s) - 1):
	if s[i] >= 'a' and s[i] <= 'z':
		p.append(s[i])
se = set(p)
print(len(se))


x = input()
count = []
sum1 = 0
for i in x:
	if ord(i) >= ord('a') and ord(i) <= ord('z') and (i not in count):
		sum1 += 1
		count.append(i)
print(sum1)


s = input()
set1 = set([])
for i in s:
	if i != '{' and i != '}' and (i != ',') and (i != ' '):
		set1.add(i)
print(len(set1))


c = {}
a = input()
c = {ord(b) for b in a if ord(b) >= 97 and ord(b) <= 122}
print(len(c))


Str = input()
s = []
for char in Str:
	if char != '{' and char != '}' and (char != ',') and (char != ' '):
		s.append(char)
print(len(set(s)))


x = input()
ar = []
if len(x) > 2:
	for i in range(1, len(x), 3):
		ar.append(x[i])
print(len(set(ar)))


l = list(input())
s = set(l)
if ' ' in l and ',' in l:
	print(len(s) - 4)
else:
	print(len(s) - 2)


def solution():
	print(int(len(set([x for x in input()[1:-1].split(', ') if x]))))
solution()


a = input()
b = ''
for i in range(1, len(a) - 1):
	if a[i] not in (',', ' '):
		b += a[i]
	else:
		continue
print(len(set(b)))


s = input().strip()
a = '{}, '
for i in a:
	s = s.replace(i, '')
print(len(set(s)))


from collections import Counter
a = list(input())
n = len(Counter(a).keys()) - 2
if len(a) > 3:
	n -= 2
print(n)


x = input()
num = set()
for i in x:
	if i.isalpha():
		num.add(i)
	continue
print(len(num))


l = list(input())
l.remove('{')
l.remove('}')
while ',' in l:
	l.remove(',')
while ' ' in l:
	l.remove(' ')
l = list(set(l))
print(len(l))


s = input()
a = []
b = []
for i in range(len(s)):
	if 97 <= ord(s[i]) <= 122:
		a.append(s[i])
a.sort()
if len(a) == 0:
	print(0)
else:
	b.append(a[0])
	for i in range(1, len(a)):
		if a[i] != a[i - 1]:
			b.append(a[i])
	print(len(b))


str = list(input())
n = len(str)
letters = []
for i in range(0, n):
	if str[i] <= 'z' and str[i] >= 'a' and (str[i] not in letters):
		letters.append(str[i])
print(len(letters))


s = input()
n = len(s)
l = []
for i in range(n):
	if s[i] != '{' and s[i] != '}' and (s[i] != ',') and (s[i] != ' '):
		l.append(s[i])
se = set(l)
print(len(se))


a = input()
list1 = []
for i in a:
	if i.isalpha() == True:
		list1.append(i)
test = []
for i in range(len(list1)):
	if list1[i] not in test:
		test.append(list1[i])
print(len(test))


s = input()
ls = []
for i in s:
	if i == '{':
		pass
	elif i == '}':
		pass
	elif i == ',':
		pass
	elif i == ' ':
		pass
	elif i not in ls:
		ls.append(i)
print(len(ls))


print(len({i for i in input().lower() if i.isalpha()}))


l = []
s = input()
if s == '{}':
	print(0)
else:
	s = ' ' + s[1:-1]
	s = s.split(',')
	for item in s:
		if item not in l:
			l.append(item)
	print(len(l))


s = set(input())
c = 0
for i in s:
	if i >= 'a' and i <= 'z':
		c += 1
print(c)


x = input()
counter = 0
for i in range(1, len(x) - 1, 3):
	counter += 1
	for j in range(1, i, 3):
		if x[i] == x[j]:
			counter -= 1
			break
print(counter)


string = input()
string_without_bracket = string[1:len(string) - 1]
alphabets = string_without_bracket.split(', ')
my_set = set((str(x) for x in alphabets))
if my_set == {''}:
	print(0)
else:
	print(len(my_set))


a = input()
a = a.lstrip('{')
a = a.rstrip('}')
b = list(set(a.split(', ')))
if b[0] == '':
	print('0')
else:
	print(len(b))


ip = input()
s = set()
for char in ip:
	if 97 <= ord(char) <= 122:
		s.add(char)
print(len(s))


occ = []
for i in range(26):
	occ.append(0)
s = input()
for c in s:
	if c >= 'a' and c <= 'z':
		occ[ord(c) - ord('a')] += 1
ans = 0
for i in range(26):
	if occ[i] > 0:
		ans += 1
print(ans)


n = input()
n = n[1:]
n = n[:-1]
n = set(n)
if len(n) > 1:
	print(len(n) - 2)
else:
	print(len(n))


x = input()
y = []
for i in x:
	if i.isalpha():
		y.append(i)
y = set(y)
print(len(y))


test = set()
s = input()
if len(s) > 2:
	for i in s[1:-1].split(', '):
		test.add(i)
	print(len(test))
else:
	print(0)


a = input()
b = set(a)
c = len(b)
if a == '{a}' or a == '{x}' or a == '{y}' or (a == '{z}'):
	print(1)
elif a == '{}':
	print(c - 2)
else:
	print(c - 4)


line = input()
lst = list(line)
letters = []
excl = [' ', ',', '{', '}']
for k in lst:
	if k not in excl:
		if k not in letters:
			letters.append(k)
print(len(letters))


a = str(input())
b = a[1:]
n = b[:len(b) - 1]
n = n.replace(' ', '')
n = n.replace(',', '')
x = list(n)
t = set(x)
print(len(t))


s = input().strip('{').strip('}')
t = len(set(s) - set(' ') - set(','))
print(t)


input_str = input()
input_str = input_str[1:-1]
input_letters = input_str.split(', ')
letters = []
for c in input_letters:
	if c and c not in letters:
		letters.append(c)
print(len(letters))


st = input()
st = st[1:len(st) - 1].split(', ')
arr = []
for i in st:
	if i not in arr and i != '':
		arr.append(i)
print(len(arr))


amany = str(input())
s = []
for value in amany:
	i = value
	if i != ' ' and i != '}' and (i != '{') and (i != ','):
		s.append(i)
unrepeated = list(dict.fromkeys(s))
print(len(unrepeated))


s = input()
l = set()
for i in s:
	if ord(i) > 96 and ord(i) <= 122:
		l.add(i)
print(len(l))


ss = input()
ll = ss[1:len(ss) - 1].split(', ')
word = {}
cnt = 0
for w in ll:
	if w not in word and w != '':
		cnt += 1
		word[w] = 1
print(cnt)


thing = input()
things = []
for x in thing:
	if x.isalpha() and (not x in things):
		things.append(x)
print(len(things))


import re
a = input()
a = re.sub('{|}|,|', '', a).replace(' ', '')
print(len(set(a)))


n = list(input())
mas = [x for x in n[1:-1]]
for i in range(mas.count(' ')):
	mas.remove(' ')
for i in range(mas.count(',')):
	mas.remove(',')
print(len(set(mas)))


l = str(input())
l.strip().split()
list = []
for i in l:
	if i.isalpha():
		if i in list:
			pass
		else:
			list.append(i)
	else:
		pass
print(len(list))


s = list(''.join(input().split()))
r = []
for i in range(1, len(s) - 1, 2):
	r.append(s[i])
print(len(set(r)))


letters = list(input())
n = len(letters)
letter = []
for i in letters:
	if 96 < ord(i) < 123 and i not in letter:
		letter.append(i)
print(len(letter))


b = set('abcdefghijklmnopqrstuvwxyz')
a = set(input())
c = a & b
print(len(c))


s = input()
x = set()
for elem in s:
	if str(elem).isalpha():
		x.add(elem)
print(len(x))


str1 = input()
str2 = str1[1:len(str1) - 1]
lis = str2.split(', ')
if any(lis):
	print(len(list(set(lis))))
else:
	print(0)


line = str(input())
line = line.replace('{', '')
line = line.replace('}', '')
line = line.split(', ')
keys = []
for letter in line:
	if not letter in keys and letter != '':
		keys.append(letter)
print(len(keys))


n = input()
n = [char for char in n]
k = []
c = ['{', ' ', ',', '}']
for i in n:
	if i not in c:
		k.append(i)
print(len(set(k)))


text = input()
list_1 = [i for i in text if i.isalpha()]
list_2 = list(set(list_1))
print(len(list_2))


s = input()
if len(s) > 2:
	s = s[1:len(s) - 1]
	l = list(map(str, s.split(', ')))
	ss = set(l)
	print(len(list(ss)))
else:
	print('0')


a = input()
s = []
for x in range(len(a)):
	if 97 <= ord(a[x]) <= 122:
		s.append(a[x])
z = set(s)
print(len(z))


import sys
from math import *
input = sys.stdin.readline
RI = lambda : [int(x) for x in sys.stdin.readline().strip().split()]
rw = lambda : input().strip().split()
from collections import defaultdict as df
import heapq
infinite = float('inf')
s = input()
n = len(s) - 1
i = 1
se = set()
while i < n:
	se.add(s[i])
	i += 3
if s == '{}\n':
	print(0)
else:
	print(len(se))


x = input()
x = str(set(x))
x = x.replace(' ', '')
x = x.replace("'", '')
x = x.replace(',', '')
x = x.replace('{', '')
x = x.replace('}', '')
r = len(x)
print(r)


T = input()
X = []
S = 0
for I in range(1, len(T) - 1, 3):
	if T[I] not in X:
		S += 1
		X.append(T[I])
print(S)


import collections
s = input()
lt = []
s_counter = collections.Counter(s)
for char in s_counter:
	if char.isalpha():
		lt.append(char)
res = collections.Counter(lt)
print(sum(res.values()))


print(len(eval(input().replace('{', "{'").replace('}', "'}").replace(', ', "', '").replace("''", ''))))


x = input()
result = 0
apperanceList = []
alapha = 'zxcvbnmasdfghjklpoiuytrewq'
for i in range(1, len(x) - 1):
	if x.count(x[i]) == 1 and x[i] in alapha:
		result += 1
		apperanceList.append(x[i])
	elif x.count(x[i]) > 1 and (not x[i] in apperanceList) and (x[i] in alapha):
		result += 1
		apperanceList.append(x[i])
print(result)


n = input()
ar = []
a = 0
if len(n) == 2:
	print('0')
else:
	for i in range(1, len(n), 3):
		for j in range(0, len(ar)):
			if n[i] == ar[j]:
				a = a + 1
		if a == 0:
			ar.append(n[i])
		a = 0
	print(len(ar))


d = input()
arr = []
count = 0
for i in d:
	if i == '{' or i == '}' or i == ',' or (i == ' '):
		continue
	elif i not in arr:
		arr.append(i)
		count += 1
print(count)


s = input()
x = set(s)
a = list(x)
if ',' and ' ' in a:
	print(len(a) - 4)
else:
	print(len(a) - 2)


import sys
from math import sqrt
inp = sys.stdin.readline
read = lambda : list(map(int, inp().split()))

def solve():
	s = inp().strip()
	s = s[1:len(s) - 1].split(', ')
	sett = {i for i in s if i}
	print(len(sett))
solve()


letters = str(input())
letter_set = set([x for x in letters if x not in ['{', '}', ' ', ',']])
print(len(letter_set))


read = input().replace('{', '').replace('}', '').replace(' ', '')
lst = list((x for x in read.split(',')))
if lst == ['']:
	print(0)
else:
	print(len(list(set(lst))))


S = input()
for i in S:
	s = list(S)
for i in s:
	if i == '{' or i == '}' or i == ',':
		s.remove(i)
for i in s:
	if i == '{' or i == '}' or i == ',' or (i == ' '):
		s.remove(i)
shit = set(s)
print(len(shit))


import re

def main(l):
	st = re.sub('[{}\\s]', '', l)
	s = set([x for x in st.split(',') if x])
	return len(s)

def test():
	assert main('{a, b, c}') == 3
	assert main('{b, a, b, a}') == 2
	assert main('{}') == 0
test()
l = input()
print(main(l))


st = input()
length = len(st)
lst = []
i = 1
while 3 * i - 2 < length:
	y = st[3 * i - 2]
	lst.append(y)
	i += 1
if '}' not in lst:
	print(len(set(lst)))
else:
	print('0')


def f():
	string = input()
	if len(string) == 2:
		print('0')
		return
	else:
		string = string[1:len(string) - 1]
		string = string.split(', ')
		uniue = list(set(string))
		print(len(uniue))
f()


__author__ = 'runekri3'
letters = set((letter for letter in input() if letter not in '{}, '))
print(len(letters))


s = input()
a = []
k = 0
m = 0
for i in range(len(s)):
	if s[i] != ',' and s[i] != '{' and (s[i] != '}') and (s[i] != ' '):
		a.append(s[i])
		k = k + 1
for i in range(k):
	for j in range(k):
		if a[i] == a[j] and i != j:
			a[i] = ''
			m = m + 1
print(k - m)


n = input()
n = n.replace('{', '')
n = n.replace('}', '')
n = set(n.split(', '))
if list(n)[0].islower():
	print(len(n))
else:
	print(0)


def solution(s):
	alphabets = set()
	for c in s:
		if c.isalpha():
			alphabets.add(c)
	return len(alphabets)
s = input()
print(solution(s))


initial = input()
(bracket1, letters) = initial.split('{')
(letters, bracket2) = letters.split('}')
sets = letters.split(', ')
final_sets = set(sets)
if sets == ['']:
	print(0)
	exit()
print(len(final_sets))


line = input()
if len(line) == 2:
	print('0')
	exit()
line = line[1:-1].split(', ')
s = set(line)
print(len(s))


string = input()
(lis, num) = ([], [])
for i in range(1, len(string) - 1):
	lis.append(string[i])
for j in lis:
	if j != ',' and j != ' ':
		num.append(j)
n = len(set(num))
print(n)


line = input()
l = [x.strip(' ') for x in line[1:-1].split(',')]
s = set()
for i in l:
	if i != '':
		s.add(i)
print(len(s))


s = input().replace(',', '').replace('{', '').replace('}', '').replace(' ', '')
r = set()
for char in s:
	r.add(char)
print(len(r))


def res(s):
	s = s[1:-1]
	if s == '':
		return 0
	c = s.split(', ')
	return len(set(c))
s = input()
print(res(s))


s = input()
arr = []
for i in range(len(s)):
	if ord(s[i]) in range(97, 123):
		arr.append(ord(s[i]))
print(len(set(arr)))


s = input()
s1 = s[1:-1]
l = list(s1.replace(', ', ''))
l1 = []
for ele in l:
	if ele not in l1:
		l1.append(ele)
print(len(l1))


a = input()
b = a.replace('}', '').replace('{', '').replace(',', '')
c = b.split()
lst = []
for x in range(len(c)):
	if c[x] not in lst:
		lst.append(c[x])
print(len(lst))


x = str(input())
k = set(x)
s = str(k)
sum = 0
for i in range(0, len(s), 1):
	if 97 <= ord(s[i]) and ord(s[i]) <= 122:
		sum += 1
print(sum)


def main():
	str = len(set(input()[1:-1].replace(',', '').split()))
	print(str)
main()


s = str(input())
s = s[1:-1]
if len(s) == 0:
	print('0')
else:
	ele = s.split(', ')
	print(len(set(ele)))


letters = input()
real_set = set()
for i in letters:
	if 'a' <= i and i <= 'z':
		real_set.add(i)
print(len(real_set))


a = input()
a = a.strip('}')
a = a + ', '
s = 0
while len(a) > 3:
	m = a[1] + ', '
	a = a.replace(m, '')
	s += 1
else:
	print(s)


line = input()
if line == '{}':
	print(0)
else:
	list = [i for i in line[1:-1].split(', ')]
	list.sort()
	n = 0
	for i in range(len(list) - 1):
		if list[i] != list[i + 1]:
			n += 1
	print(n + 1)


a = input().strip('{}').split(', ')
if '' in a:
	a.remove('')
print(len(set(a)))


n = input()
x = 0
for i in 'abcdefghijklmnopqrstuvwxyz':
	if n.count(i) > 0:
		x += 1
print(x)


a = input()
a = a[1:-1]
a = a.split(', ')
for i in a:
	if i == '':
		a.remove(i)
x = len(set(a))
print(x)


a = input()
if len(a) == 2:
	print(0)
else:
	b = a[1:-1].split(', ')
	t = set(b)
	print(len(t))


s = input()
s = list(s)
list1 = []
for i in s:
	if 97 <= ord(i) <= 122:
		list1.append(i)
list1 = set(list1)
print(len(list1))


ls = set()
line = input()
for i in range(1, len(line), 3):
	if line[i].isalpha():
		ls.add(line[i])
print(len(ls))


import collections
s = input()
print([len(collections.Counter(sorted(s[1::3]))), 0][len(s) <= 2])


from sys import stdin, stdout
from math import gcd, sqrt, floor, ceil
input = stdin.readline

def list_inp(x):
	return list(map(x, input().split()))

def map_inp(x):
	return map(x, input().split())

def lcm(a, b):
	return a * b / gcd(a, b)
s = input().strip('\n')
s1 = set()
for i in s:
	if i.isalpha():
		s1.add(i)
print(len(s1))


s = input()
x = []
p = ['{', ',', '}', ' ']
for i in s:
	if i not in p:
		x.append(i)
a = set(x)
print(len(a))


count = 0
letters = set()
for char in input():
	if char.isalpha() and char not in letters:
		letters.add(char)
		count += 1
print(count)


s = list(set(input()[1:-1].split(', ')))
s2 = filter(lambda x: len(x) != 0, s)
print(len(list(s2)))


from sys import stdin
string = stdin.readline()
ans = set()
if len(string.strip()) == 2:
	print(0)
else:
	for i in range(1, len(string), 3):
		ans.add(string[i])
	print(len(ans))


str1 = input()
list1 = [x for x in str1[1:-1].split(', ')]
list2 = list(set(list1))
if list2[0] == '':
	print(0)
else:
	print(len(list2))


def solve():
	st_str = input()
	clean_str = st_str[1:-1]
	letters = clean_str.split(', ')
	ans = len(set(letters))
	if clean_str != '':
		print(ans)
	else:
		print('0')
solve()


def main():
	s = input()
	if len(s) == 2:
		print(0)
	else:
		print(len(set(s[1:-1].split(', '))))
main()


import math
import string
a = input()
b = len(a)
k = 0
if a == '{}':
	print(0)
else:
	a = list(set(a))
	a = [''.join((c for c in s if c not in string.punctuation)) for s in a]
	x = [str(s) for s in ''.join(a) if str(s).isalpha()]
	for i in x:
		if i.isalpha():
			k = k + 1
	print(k)


def gundan(n):
	return n not in ['{', '}', ',', ' ']
n = input()
b = set(n)
c = filter(gundan, b)
print(len(list(c)))


line = list(input())
num = 0
v = []
for i in range(1, len(line) - 1, 3):
	if i == 1:
		num = num + 1
		v.append(line[i])
		continue
	jaTem = False
	for k in range(len(v)):
		if line[i] == v[k]:
			jaTem = True
			break
	if jaTem == False:
		num = num + 1
	v.append(line[i])
print(num)


print(len(dict(((i, 0) for i in input()[1:-1].split(', ') if not i == ''))))


import re
print(len(set(re.findall('[a-z]', input()[1:-1]))))


n = input()
n = n.replace('{', '')
n = n.replace('}', '')
if n == '':
	print(0)
else:
	l = n.split(',')
	lnew = []
	for i in l:
		i = i.replace(' ', '')
		if i not in lnew:
			lnew.append(i)
	print(len(lnew))


s = str(input())
alpha = list(s)
alpha = list(set(alpha))
if ',' in alpha:
	n = len(alpha) - 4
if ',' not in alpha:
	n = len(alpha) - 2
print(n)


import string
letters = string.ascii_lowercase
test = input()
result = ''
for x in test:
	if x in letters:
		if x not in result:
			result += x
print(len(result))


dict = {}
for i in range(97, 123):
	dict[i] = 0
s = input()
length = len(s)
cnt = 0
for i in range(length):
	if ord(s[i]) >= 97 and ord(s[i]) <= 122 and (dict[ord(s[i])] == 0):
		dict[ord(s[i])] += 1
		cnt += 1
print(cnt)


letters = input()
letters = letters.replace('{', '')
letters = letters.replace('}', '')
letters = letters.replace(',', '')
letters_list = letters.split(' ')
letters_set = set(letters_list)
count = 0
for letter in letters_set:
	if letter == '':
		count += 0
	else:
		count = len(letters_set)
print(count)


line = input()
line = set(line)
if len(line) > 3:
	print(len(line) - 4)
elif len(line) == 3:
	print(len(line) - 2)
else:
	print(len(line) - 2)


ls = set()
for c in input():
	if c.islower():
		ls.add(c)
print(len(ls))


s = input()
s = s.rstrip('}')
s = s.lstrip('{')
s = s.replace(' ', '')
l = s.split(',')
d = {}
if s == '':
	print('0')
else:
	for i in l:
		d[i] = d.get(i, 0) + 1
	k = d.keys()
	print(len(k))


antonSet = input()[1:-1].split(', ')
if antonSet[0] == '' and len(antonSet):
	print(0)
else:
	print(len(set(antonSet)))


l = input().split()
str1 = ''.join(l)
k = []
a = list(str1)
for i in a:
	if i.isalpha():
		k.append(i)
print(len(set(k)))


L = input()
L = L[1:-1]
if L == '':
	print(0)
	exit()
L = L.split(', ')
print(len(set(L)))


print(len(set(filter(lambda x: 123 > ord(x) > 44, input()))))


l = [str(i) for i in input()]
if len(l) == 3:
	a = 1
elif len(l) == 2:
	a = 0
else:
	l = list(set(l))
	a = len(l) - 4
print(a)


lst = list(input())
set1 = set([])
for i in range(1, len(lst) - 1):
	if lst[i] != '{' and lst[i] != '}' and (lst[i] != ',') and (lst[i] != ' '):
		set1.add(lst[i])
print(len(set1))


def myMethod(s):
	s = s.replace(' ', '')
	res = {''}
	for i in range(1, len(s) - 1, 2):
		res.add(s[i])
	return len(res) - 1
s = str(input())
print(myMethod(s))


n = list(input())
a = 97
s = 0
while a < 123:
	if chr(a) in n:
		s = s + 1
	a = a + 1
print(s)


s = list(input())
s = [i for i in s if i != ',' and i != '{' and (i != '}') and (i != ' ')]
s = set(s)
print(len(s))


rez = 0
bukv = []
a = input()
for i in a:
	if 97 <= ord(i) <= 122 and i not in bukv:
		rez += 1
		bukv.append(i)
print(rez)


from collections import Counter
text = input()
if text == '{}':
	print('0')
else:
	text = text.replace('{', '')
	text = text.replace('}', '')
	li = list(text.split(', '))
	print(len(Counter(li).keys()))


print(len(set(filter(str.isalpha, input()))))


q = input() + ', '
print(len(set(q)) - 4)


s = input()
s = s.replace(',', '')
s = s[1:-1]
s = s.split()
li = []
for i in s:
	if i in li:
		continue
	else:
		li.append(i)
print(len(li))


s = input()
cnt = 0
m = []
s = s[1:-1]
if s == '':
	print(0)
else:
	for i in s.split(', '):
		if i not in m:
			cnt += 1
		if s.count(i) > 1:
			m.append(i)
	print(cnt)


s = input()
length = len(s)
if length == 2 or length == 3:
	print(length - 2)
else:
	sett = set(s)
	print(len(sett) - 4)


s = input()
s = s.replace('{', '')
s = s.replace(',', '')
s = s.replace('}', '')
s = s.split()
k = set(s)
print(len(k))


inStr = input()
if inStr == '{}':
	print(0)
else:
	word = inStr[1:-1].split(', ')
	print(len(set(word)))


x = input()
if len(x) > 3:
	print(len(set(x)) - 4)
else:
	print(len(x) - 2)


s = input()
s_mod = s[1:-1].split(', ')
if s_mod == ['']:
	print(0)
else:
	set_s_mod = set(s_mod)
	print(len(set_s_mod))


s = input()
p = []
for i in range(len(s)):
	if s[i] not in p and s[i] not in [',', ' ', '{', '}']:
		p.append(s[i])
print(len(p))


arr = list(map(str, input().split(', ')))
arr[0] = arr[0].replace('{', '')
arr[-1] = arr[-1].replace('}', '')
newarr = []
answer = 0
for element in arr:
	if len(element) > 0:
		if element not in newarr:
			newarr.append(element)
			answer += 1
print(answer)


l = list(input())
k = []
for x in l:
	if x != ',' and x != '{' and (x != '}') and (x != ' '):
		k.append(x)
print(len(set(k)))


s = input()
x = []
for i in range(1, len(s) - 1, 3):
	if s[i] == '}':
		break
	if s[i] not in x:
		x.append(s[i])
print(len(x))


def anton():
	instr = input()
	instr = instr.strip('{')
	instr = instr.strip('}')
	instr = instr.replace(' ', '')
	lst = instr.split(',')
	counter = 0
	if instr == '':
		print(0)
	else:
		for c in range(len(lst)):
			if lst[c] in lst[c + 1:]:
				counter += 1
		print(len(lst) - counter)
anton()


string = input()
length = len(string)
li = []
for i in range(1, length, 3):
	if string[i].isalpha():
		li.append(string[i])
li = list(dict.fromkeys(li))
print(len(li))


line = input()
a = set(line[1:-1].split(', '))
if len(line) == 2:
	print(0)
else:
	print(len(a))


s = str(input())
s = s.replace(',', '')
s = s.replace('{', '')
s = s.replace('}', '')
s = s.replace(' ', '')
arr = []
for i in range(len(s)):
	arr.append(s[i])
arr = list(set(arr))
print(len(arr))


s = str(input())
a = set()
for x in s:
	if 65 <= ord(x) <= 122:
		a.add(x)
print(len(a))


var = input()
list1 = []
for i in range(len(var)):
	if var[i] == '{' or var[i] == '}' or var[i] == ',' or (var[i] == ' '):
		continue
	elif list1.count(var[i]) == 0:
		list1.append(var[i])
print(len(list1))


l = []
for ch in str(input()):
	if ch not in ['{', ',', '}', ' '] and ch not in l:
		l.append(ch)
print(len(l))


alpha = input()
o = []
for i in alpha:
	if i.isalpha():
		o.append(i)
o = list(dict.fromkeys(o))
print(len(o))


x = input()
y = x[1:len(x):3]
l = []
if x == '{}':
	print('0')
else:
	for i in y:
		if i not in l:
			l.append(i)
	print(len(l))


def solve(text):
	text = text[1:-1]
	if text == '':
		return 0
	chars = text.split(', ')
	return len(set(chars))
text = input()
print(solve(text))


s = set(map(lambda i: i.strip(), input()[1:-1].split(',')))
print(0 if '' in s else len(s))


str1 = input()
list1 = str1.split(', ')
list2 = []
if len(str1) == 2:
	print('0')
elif len(str1) == 3:
	print('1')
else:
	one = list1[0]
	final = list1[-1]
	list2.append(one[1:])
	list2.append(final[:1])
	for i in range(1, len(list1) - 1):
		list2.append(list1[i])
	s = set(list2)
	print(len(s))


from collections import Counter

def Anton(s):
	c = Counter(s)
	res = 0
	return len(c)
x = input()
s = []
i = 1
while i < len(x):
	if x[i] != ' ' and x[i] != ',' and (x[i] != '}'):
		s.append(x[i])
	i = i + 1
print(Anton(s))


n = input()
prev = []
count = 0
if not n == '{}':
	for i in n[1:-1].split(', '):
		if i not in prev:
			count += 1
			prev.append(i)
print(count)


import re
n = input()
n = re.sub('[^a-z]', '', n)
n = set(n)
print(len(n))


s = input('')
m = s.replace('{', '')
n = m.replace('}', '')
p = n.replace(', ', '')
list1 = []
for i in p:
	list1.append(i)
list2 = list(set(list1))
print(len(list2))


print(len(set(input().lstrip('{').rstrip('}').replace(', ', ' ').split())))


a = list(input())
c = ''
b = 'abcdefghijklmnopqrstuvwxyz'
for i in b:
	if i in a:
		c += i
c.strip()
print(len(c))


x = input()
x = list(x)
x.pop()
x.pop(0)
x = ''.join(x)
if len(x) == 0:
	print(0)
else:
	x = x.split(', ')
	count = list()
	for i in x:
		if i not in count:
			count.append(i)
	print(len(count))


n = input()
a = []
for i in n:
	if 'a' <= i <= 'z':
		a.append(i)
print(len(set(a)))


import math

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(mi())
a = input()
a = list(a)
b = []
count = j = 0
for i in range(len(a)):
	if a[i] == ',' or a[i] == '{' or a[i] == '}' or (a[i] == ' '):
		count += 1
	elif a[i] not in b:
		b.append(a[i])
	else:
		j += 1
print(len(a) - count - j)


set = input()
i = 1
count = 0
j = set.find('}')
arr = []
while i < j:
	x = set[i]
	if x not in arr:
		arr.append(x)
		count += 1
	i += 3
print(count)


st = input().lstrip('{').rstrip('}').split(', ')
re = dict()
for i in st:
	if i == '':
		continue
	re[i] = 1
if st == '':
	print(0)
else:
	print(len(re))


s = list(input().split(', '))
h = [0] * 26
ans = 0
for i in s:
	for j in i:
		if 'a' <= j <= 'z':
			h[ord(j) - ord('a')] = 1
for i in h:
	if i:
		ans += 1
print(ans)


b = input()
if len(b) > 2:
	b = b[1:len(b) - 1]
	g = set(b.split(', '))
	print(len(g))
else:
	print(0)


n = input()
li = []
for word in n:
	if word not in li:
		if 97 <= ord(word) <= 122:
			li.append(word)
print(len(li))


l = []
m = input()
for i in m:
	k = ord(i)
	if k > 96 and k < 123:
		l.append(k)
print(len(list(set(l))))


s = str(input())
l = [',', ' ', '{', '}']
x = {}
for i in s:
	if i in l:
		continue
	if i not in x.keys():
		x[i] = 1
	else:
		x[i] += 1
print(len(x))


line = str(input())
list0 = []
s = 0
for i in line:
	if 'a' <= i <= 'z':
		list0.append(ord(i))
list0.sort()
for i in range(len(list0)):
	if i < len(list0) - 1:
		if list0[i] != list0[i + 1]:
			s += 1
if list0 != []:
	s += 1
print(s)


b = input()
l = ['{', '}', ',']
for i in l:
	b = b.split(i)
	b = ' '.join(b)
b = b.split(' ')
s = 0
if b[1] == '':
	s = 0
elif len(b) == 3:
	s = 1
else:
	line = []
	m = b[1]
	line.append(m)
	q = 1
	for i in range(1, len(b) - 1):
		if b[i] not in line and b[i] != '':
			line.append(b[i])
			q += 1
	s = q
print(s)


import string
nums = set(input()).intersection(string.ascii_lowercase)
print(len(nums))


a = input()
if a == '{' or a == '}' or a == '{}':
	print('0')
	exit(0)
a = a[1:-1]
print(len(set(a.split(', '))))


tum = input()
letters = tum[1:-1]
xx = set(letters.split(', '))
if tum == '{}':
	print(0)
else:
	print(len(xx))


s = input()
dic = {}
for c in s:
	if ord(c) >= ord('a') and ord(c) <= ord('z'):
		dic[c] = 1
ans = 0
for c in dic.keys():
	ans = ans + 1
print(ans)


from sys import stdin, stdout
s = stdin.readline()
if s != '{}\n':
	v = s[1:len(s) - 2].split(', ')
	stdout.write(str(len(set(v))))
else:
	stdout.write('0')


n = input().strip('{')
n = n.strip('}')
s = set(n.split(', '))
if '' in s:
	s = s.remove('')
if s == None:
	print(0)
else:
	print(len(s))


letter = set(input())
letternew = set()
for i in letter:
	if i.isalpha():
		letternew.add(i)
print(len(letternew))


s = input()[1:-1]
my_set = set(s)
if ',' in my_set:
	my_set.remove(',')
if ' ' in my_set:
	my_set.remove(' ')
print(len(my_set))


chr = input()
l = []
for i in chr:
	if i.isalpha():
		l.append(i)
print(len(set(l)))


def main():
	from sys import stdin, stdout
	s = set(stdin.readline().strip()[1:-1].split(', '))
	if '' in s:
		stdout.write('0')
	else:
		stdout.write(str(len(s)))
main()


def discos():
	word = list(input())
	letters = list()
	lets = int()
	lastx = str()
	for x in range(1, len(word) - 1, 3):
		letters.append(word[x])
	letters.sort()
	for x in range(0, len(letters)):
		if lastx != letters[x]:
			lets += 1
			lastx = letters[x]
	print(lets)
discos()


a = list(input())
a.remove('{')
a.remove('}')
if len(a) == 0:
	print(0)
elif len(a) == 1:
	print(1)
else:
	print(len(set(a)) - 2)


s = input()
new_s = s[1:len(s) - 1]
A = new_s.split(', ')
print(len(set(A)) - (len(s) == 2))


string = input()[1:-1:3]
distinct_chars = []
for char in string:
	if char not in distinct_chars:
		distinct_chars.append(char)
print(len(distinct_chars))


sta = [i for i in input()]
fin = []
sta.sort()
if 'a' <= sta[0] <= 'z':
	fin.append(sta[0])
for i in range(1, len(sta)):
	if sta[i] == sta[i - 1]:
		pass
	elif sta[i] == ',' or sta[i] == '{' or sta[i] == '}':
		pass
	else:
		fin.append(sta[i])
print(len(fin))


a = input()
a = a.lstrip('{')
a = a.rstrip('}')
a = a.split(', ')
m = 0
if a == ['']:
	s = 0
else:
	s = 1
	for i in range(1, len(a)):
		for k in range(0, i):
			if a[k] != a[i]:
				m += 1
		if m == i:
			s += 1
		m = 0
print(s)


n = []
s = input()
for i in s:
	if i != '{':
		if i != '}':
			if i != ',':
				if i != ' ':
					n.append(i)
n = set(n)
print(len(n))


a = input()[1:-1].split(',')
if a[0] == '':
	print(0)
else:
	b = [x[-1] for x in a]
	s = set()
	s.update(b)
	print(len(s))


a = input()
if a == '{}':
	print(0)
else:
	b = a[1:-1]
	k = b.split(', ')
	print(len(set(k)))


import sys
import math
s = set(input().replace(' ', ''))
if ',' in s:
	print(len(s) - 3)
else:
	print(len(s) - 2)


s = input()[1:-1].replace(' ', '').split(',')
s = [e for e in s if e != '']
print(len(set(s)))


import math
line = input()
line = line[1:]
line = line[:len(line) - 1]
line = line.replace(' ', '')
if len(line) == 0:
	print(0)
else:
	arr = line.split(',')
	mySet = set(arr)
	print(len(mySet))


s = input()
s = s[1:-1]
count = 0
l = list()
s = s.replace(' ', '')
s = s.replace(',', '')
for i in s:
	if i not in l:
		count = count + 1
		l.append(i)
print(count)


from sys import stdin, stdout
from math import ceil, floor
from collections import deque
inp = stdin.readline
out = stdout.write
s = inp().strip().split(',')
l = set()
for i in s:
	i = i.strip()
	if '{}' in i:
		continue
	elif '{' in i:
		l.add(i[1])
	elif '}' in i:
		l.add(i[0])
	else:
		l.add(i)
out(str(len(l)))


s1 = input()
a = s1.split('{')[1]
b = a.split('}')[0]
lis = list(map(str, b.strip().split(',')))
for i in range(len(lis)):
	lis[i] = lis[i].strip()
check = []
for i in lis:
	if i in check:
		pass
	elif i != '':
		check.append(i)
print(len(check))


s = list(input())
s.pop(0)
s.pop(len(s) - 1)
if len(s) > 1:
	print(len(set(s)) - 2)
else:
	print(len(s))


a = input()
i = 0
for m in range(65, 91):
	if a.find(chr(m)) >= 0:
		i += 1
for m in range(97, 123):
	if a.find(chr(m)) >= 0:
		i += 1
print(i)


print(len(set(filter(lambda i: len(i) > 0, list(map(lambda i: i.strip(), input()[1:-1].split(',')))))))


ok = input()
if ok == '{}':
	print(0)
else:
	print(len(set(ok[1:len(ok) - 1].split(', '))))


iset = input()
if iset == '{}':
	print(0)
else:
	iset_letter = iset[1:-1].split(', ')
	iset_letter_set = set(iset_letter)
	print(len(iset_letter_set))


print(len(set(list(filter(None, map(lambda x: x.strip(), input()[1:-1].split(',')))))))


a = input()
b = set(a)
t = 0
for x in b:
	if x in ['}', '{', ',', ' ']:
		pass
	else:
		t += 1
print(t)


s = input()
l = list(s)
s1 = set(l)
c = 0
alphabets = 'abcdefghijklmnopqrstuvwxyz'
for i in s1:
	if i in alphabets:
		c += 1
print(c)


line = input()
n = 0
if line == '{}':
	print(0)
else:
	list = [i for i in line[1:-1].split(', ')]
	while list != []:
		n += 1
		x = 0
		b = list[0]
		a = list.count(b)
		while x < a:
			list.remove(b)
			x += 1
	print(n)


s = input()
a = []
if len(s) == 2:
	print('0')
else:
	for i in range(1, len(s)):
		if s[i] != ',' and s[i] != '}' and (s[i] != ' '):
			a.append(s[i])
	print(len(set(a)))


print(len(set(filter(lambda z: z, map(lambda x: x.strip(), input()[1:-1].split(','))))))


ch = input('')
i = 0
l = []
s = {}
for i in range(len(ch)):
	l.append(ch[i])
while '{' in l:
	l.remove('{')
while ' ' in l:
	l.remove(' ')
while '}' in l:
	l.remove('}')
while ',' in l:
	l.remove(',')
s = set(l)
print(len(s))


n = input()
if len(n) > 2:
	a = ''
	for i in range(1, len(n), 3):
		a += n[i]
	c = set(a)
	b = str(c)
	d = 0
	for i in range(2, len(b), 5):
		d = d + 1
	print(d)
else:
	print(0)


lettersSet = input()
letters = []
for element in lettersSet:
	if ord(element) >= ord('a') and ord(element) <= ord('z'):
		letters.append(element)
print(len(set(letters)))


l = list(input())
l.pop(0)
l.pop()
s = ''
for i in l:
	s = s + i
s = s.split(', ')
if s[0] == '':
	print(0)
else:
	print(len(set(s)))


masukan = input()
tampung = []
for i in range(len(masukan)):
	if masukan[i] not in tampung:
		if masukan[i] == '{' or masukan[i] == '}' or masukan[i] == ',' or (masukan[i] == ' '):
			continue
		else:
			tampung += masukan[i]
print(len(tampung))


import re
word = re.findall('\\w', input())
if len(word) == 0:
	print(0)
else:
	a = []
	for i in word:
		if i not in a:
			a.append(i)
	print(len(a))


s = input().strip(' ')
s = s.strip('{')
s = s.strip('}')
s = s.split(', ')
l = []
if s != ['']:
	for letter in s:
		if letter in l:
			continue
		else:
			l = l + [letter]
print(len(l))


a = input()
n = len(a)
if n <= 2:
	print('0')
else:
	s = []
	for i in range(1, n, 3):
		s.append(a[i])
	ss = list(set(s))
	print(ss.__len__())


a = input()[1:-1]
if len(a) == 0:
	print('0')
elif len(a) == 1:
	print('1')
else:
	print(len(set([x for x in a.split(', ')])))


str0 = input().lstrip('{').rstrip('}').split(', ')
str0 = list(dict.fromkeys(str0))
if str0 == ['']:
	str0 = []
print(len(str0))


s = input()
a = set()
for i in range(len(s)):
	if ord(s[i]) >= 97 and ord(s[i]) <= 122:
		a.add(s[i])
print(len(a))


n = input().split(',')
lst = []
for i in n:
	for j in i:
		if j.isalpha():
			lst.append(j)
print(len(set(lst)))


def distinct_number(s):
	s = s[1:-1]
	unwanted_char = [' ', ',']
	wanted_number = []
	for char in s:
		if char not in unwanted_char:
			wanted_number.append(char)
	distinct_chars = []
	distinct_chars_no = 0
	while len(wanted_number) > 0:
		temp = wanted_number.pop()
		if temp not in distinct_chars:
			distinct_chars_no += 1
			distinct_chars.append(temp)
	print(distinct_chars_no)
s = input()
distinct_number(s)


message = input()
A = []
for ch in message:
	if 97 <= ord(ch) <= 122:
		A.append(ord(ch))
a = len(A)
B = 26 * [0]
for i in range(a):
	B[A[i] - 97] += 1
print(26 - B.count(0))


a_set = input()[1:-1].strip()
a_set = a_set.replace(' ', '')
a_set = a_set.replace(',', '')
print(len(set(a_set)))


s = input().strip()[1:-1]
letters = [0] * 26
i = 0
while i < len(s):
	if i % 3 == 0:
		index = ord(s[i]) - ord('a')
		letters[index] = 1
	i = i + 1
c = 0
for x in letters:
	if x != 0:
		c = c + 1
print(c)


arr = input()
ans = set()
for i in arr:
	if ord(i) >= 97 and ord(i) <= 122:
		ans.add(i)
print(len(ans))


print(len(set([i for i in input().strip('{').rstrip('}').split(', ') if i != ''])))


s = input()
abc = []
for i in range(1, len(s), 3):
	abc.append(s[i])
abc = set(abc)
print(len(abc) if len(s) > 2 else 0)


x = input('')
if x == '{}':
	print(0)
else:
	a = list(x[1:-1].split(', '))
	b = set(a)
	print(len(b))


s = input()
if s == '{}':
	print('0')
elif ',' not in s:
	print('1')
else:
	i = 1
	l = []
	while i <= len(s):
		l.append(s[i])
		i += 3
	print(len(set(l)))


i = input()
if i == '{}':
	print('0')
else:
	l = i.split(', ')
	a = list(l[0])
	b = list(l[-1])
	l[0] = a[1]
	l[-1] = b[0]
	print(len(set(l)))


s = input()
n = s[1:len(s) - 1].split(', ')
N = []
for i in n:
	if i == '':
		break
	elif i not in N:
		N.append(i)
print(len(N))


s = input()
print(len(set(s[1:len(s) - 1] + ' ,')) - 2)


letter = [chr(i) for i in range(97, 123)]
ans = 0
l = input()
for c in letter:
	if c in l:
		ans += 1
print(ans)


s = list(input())
if s == ['{', '}']:
	print(0)
else:
	lis = []
	for i in range(len(s) - 1):
		if s[i + 1] in [',', '}']:
			lis.append(s[i])
	print(len(list(set(lis))))


w = input()
x = list(set(w[1:-1].split(', ')))
if x == ['']:
	print(0)
else:
	print(len(x))


s = input()
alpha = 'abcdefghijklmnopqrstuvwxyz'
char = []
for ch in s:
	if ch in alpha and ch not in char:
		char.append(ch)
print(len(char))


n = input()
print(len({j for j in n if j not in '},{ '}))


import time

def countDistinct(letArr):
	distinct = 0
	distLet = []
	for x in letArr:
		if x not in distLet:
			distLet.append(x)
			distinct += 1
	return distinct

def solve():
	istr = input()
	if len(istr) == 2:
		print(0)
		return
	rstr = [str(x) for x in istr[1:len(istr) - 1].split(', ')]
	start_time = time.time()
	print(countDistinct(rstr))
solve()


letter = str(input())
l = []
for i in letter:
	if ord(i) >= 97 and ord(i) <= 122:
		l.append(i)
l.sort()
count = 0
if len(l) != 0:
	for i in range(1, len(l)):
		if l[i - 1] != l[i]:
			count += 1
	print(count + 1)
else:
	print(0)


import re
p = '[a-z]'
t = input()
m = re.findall(p, t)
if m:
	print(len(set(m)))
else:
	print('0')


Set = input()[1:-1]
Set = len(set(Set.replace(',', '').split()))
print(Set)


x = input()
temp = []
count = 0
for i in x:
	if i not in temp:
		if (i != '{') & (i != '}') & (i != ' ') & (i != ','):
			count += 1
			temp.append(i)
print(count)


a = input()
A = set(a)
B = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'}
A.intersection_update(B)
z = list(A)
print(len(z))


a = set(input().strip('{}').split(', '))
if len(a) == 1:
	print(len(list(a)[0]))
else:
	print(len(a))


word = input()
l = []
counter = 0
for i in range(len(word)):
	if ord(word[i]) < 123 and ord(word[i]) > 58:
		l.append(word[i])
l.sort()
if len(l) > 0:
	counter += 1
for i in range(1, len(l)):
	if l[i] != l[i - 1]:
		counter += 1
print(counter)


a = input()
b = sorted(a)
l = []
c = 0
for i in b:
	if i not in l:
		if i >= 'a' and i <= 'z':
			l.append(i)
			c = c + 1
print(c)


s = len(set(input())) - 4
if s == -1:
	s = 1
elif s == -2:
	s = 0
print(s)


n = input()
n = n[1:-1]
n = [x for x in n if x.isalpha() == True]
print(len(set(n)))


s = input()
s2 = set()
for i in s:
	if i.isalpha():
		s2.add(i)
print(len(s2))


s = set(input()[1:-1].split(', '))
s.discard('')
print(len(s))


from collections import Counter
s = input()
ans = 0
count = Counter(s)
for (i, j) in count.items():
	if i.isalpha():
		ans += 1
print(ans)


line = [ch.strip() for ch in input().strip()[1:-1].split(',')]
print(len(set(line)) if line != [''] else 0)


a = input()
a = a[1:-1].split(', ')
leng = len(set(a)) if '' not in a else 0
print(leng)


s = input()
letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
w = set()
for i in s:
	if i in letters:
		w.add(i)
print(len(w))


print(len(set(filter(lambda v: len(v), input()[1:-1].split(', ')))))


in_set = set(input()[1:-1].split(', '))
in_set.discard('')
print(len(in_set))


inp = input().split()
array = []
if len(inp[0]) == 2:
	print('0')
else:
	inp[0] = inp[0][1]
	array.append(str(inp[0]))
	for i in range(1, len(inp)):
		inp[i] = inp[i][0]
		array.append(str(inp[i]))
	seet = set(array)
	print(len(seet))


n = input().split()
n = ''.join(n)
n = list(n)
if n == ['{', '}']:
	print(0)
	quit()
for i in n:
	if i == '{' or i == '}' or i == ',':
		n.remove(i)
n = set(n)
print(len(n))


from sys import stdin
s = stdin.readline().strip().replace(' ', '')[1:-1]
if s:
	print(len(set(s.split(','))))
else:
	print(0)


import re

def solve():
	print(len(set(re.split('[}{, ]', input()))) - 1)
solve()


x = list(input().split(', '))
if x[0] != '{}':
	(x[0], x[len(x) - 1]) = (x[0][1], x[len(x) - 1][0])
	for i in x:
		i = ord(i) - ord('a')
	x.sort()
	temp = ''
	(length, count) = (len(x) - 1, 0)
	while count <= length:
		if x[count] == temp:
			del x[count]
			length -= 1
		else:
			temp = x[count]
			count += 1
	print(len(x))
else:
	print(0)


set1 = input()
list1 = set1[1:-1]
if not list1:
	print(0)
else:
	print(len(set(list1.split(', '))))


s = input()
c = []
for i in range(len(s)):
	if s[i] == '{' or s[i] == '}' or s[i] == ',' or (s[i] == ' '):
		continue
	else:
		c.append(s[i])
if len(c) == 0:
	print('0')
else:
	print(len(set(c)))


string = input()
string2 = ''
for i in string:
	if i >= 'a' and i <= 'z' or (i >= 'A' and i <= 'Z'):
		if i not in string2:
			string2 += i
print(len(string2))


x = set(input())
if len(x) >= 4:
	s = int(len(x) - 4)
elif len(x) == 2:
	s = 0
elif ' ' in x:
	s = 0
else:
	s = 1
print(s)


from string import ascii_lowercase

def main():
	s = input()
	i = 0
	for c in ascii_lowercase:
		if c in s:
			i += 1
	print(i)
main()


s = input()
s = s.split(', ')
if len(s) == 1:
	if len(s[0]) == 3:
		l = 1
	else:
		l = 0
else:
	a = list(s[0])
	del a[0]
	a = ''.join(a)
	s[0] = a
	b = list(s[-1])
	del b[-1]
	b = ''.join(b)
	s[-1] = b
	s = set(s)
	s = list(s)
	l = len(s)
print(l)


from collections import Counter
s = input()
s = s.replace(' ', '')
s = s.replace(',', '')
s = s.replace('{', '')
s = s.replace('}', '')
a = Counter(s)
print(len(a))


line = input().split(', ')
n = len(line)
line[0] = line[0].replace('{', '')
line[n - 1] = line[n - 1].replace('}', '')
existings = {}
distincts = 0
for letter in line:
	if line.count(letter) > 1:
		if not existings.get(letter, False):
			existings[letter] = True
			distincts += 1
	elif letter != '':
		distincts += 1
print(distincts)


l1 = input()
l2 = list(filter(lambda a: a != ',' and a != ' ' and (a != '}') and (a != '{'), l1))
print(len(set(l2)))


m = input()
t = m.split()
v = {}
for i in range(len(t)):
	t[i] = t[i].strip(',{}')
	if t[i] != '':
		v[t[i]] = v.get(t[i], 0) + 1
print(len(v))


n = input()
n = list(set(n))
if len(n) > 5:
	print(len(n) - 4)
elif len(n) == 2:
	print('0')
else:
	print('1')


import sys
import math
import bisect
import re

def main():
	s = input()
	g = re.findall('[a-z]', s)
	print(len(set(g)))
main()


a = input()
if a == '{}':
	print(0)
else:
	g = []
	a = a[1:-1]
	f = list(a.split(','))
	for x in range(len(f)):
		if g.count(f[x].strip()) == 0:
			g.append(f[x].strip())
	print(len(g))


z = input()
k = []
if z == '{}':
	print(0)
else:
	n = 1
	while n < len(z):
		if z[n] not in k:
			k.append(z[n])
		n += 3
	print(len(k))


str = input()
str = str.replace('{', '')
str = str.replace('}', '')
str = str.replace(', ', '')
mylist = list(str)
mylist = list(set(mylist))
print(len(mylist))


ch = str(input())
n = len(ch)
e = set()
for k in range(n // 3):
	e.add(ch[3 * k + 1])
print(len(e))


list = input()
text = []
for i in range(len(list)):
	if i % 3 == 1:
		text.append(list[i])
if len(list) == 2:
	print('0')
else:
	count = 1
	for i in range(1, len(text)):
		if text[i] not in text[:i]:
			count = count + 1
	print(count)


k = ['{', '}', ',', ' ']
count = 0
k1 = set(input())
for x in k1:
	if x not in k:
		count += 1
print(count)


n = list(input())
a = set()
for i in range(len(n)):
	if n[i].isalpha() == True:
		a.update(n[i])
print(len(a))


string = input()
unique = []
for i in string:
	if ord(i) >= 97 and ord(i) <= 122 and (i not in unique):
		unique.append(i)
print(len(unique))


s = input()
s = s.strip('{}')
l = s.replace(',', '')
l = l.replace(' ', '')
r = set(l)
print(len(r))


string = input()
l = []
for c in string:
	if 96 < ord(c) < 123:
		l.append(c)
s = set(l)
print(len(s))


str = input()
counts = dict()
c = 0
for x in str:
	counts[x] = counts.get(x, 0) + 1
for x in counts:
	if ord(x) != 32 and ord(x) != 44:
		c += 1
print(c - 2)


s = input()
s = s[1:-1]
l = s.split(', ')
if l[0] == '':
	print('0')
else:
	sl = set(l)
	print(len(sl))


hello = input().split()
if hello[0][1] == '}':
	final = []
else:
	final = [hello[0][1]]
answer = []
for i in range(len(hello) - 1):
	final.append(hello[i + 1][0])
for i in range(len(final)):
	if final[i] not in answer:
		answer.append(final[i])
print(len(answer))


k = input()
if k == '{}':
	print(0)
else:
	g = set()
	k = k[1:-1]
	for i in range(len(k) // 3 + 1):
		g.add(k[3 * i])
	print(len(g))


c = input()
w = []
d = 0
x = 'abcdefghijklmnopqrstuvwxyz'
for i in c:
	if i not in w:
		w.append(i)
for i in w:
	if i in x:
		d += 1
print(d)


lst = input().strip()[1:-1].split(', ')
print(len(set(lst)) if lst[0] != '' else 0)


i = input().replace('{', '')
i = i.replace('}', '')
i = i.split(', ')
count = 0
d = []
for t in i:
	if t not in d and t != '':
		count = count + 1
		d.append(t)
print(count)


s = input()[1:-1].replace(' ', '').split(',')
d = {}
for i in s:
	if i != '':
		if i in d:
			d[i] += 1
		else:
			d[i] = 1
print(len(d))


from sys import stdin, stdout
s = stdin.readline()
s_list = list(s)
string_lst = []
for item in s_list:
	if item.isalpha() and item not in string_lst:
		string_lst.append(item)
stdout.write(str(len(string_lst)))


arr = input()
sum = 0
alph = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
for i in alph:
	if i in arr:
		sum += 1
print(sum)


word = set(input())
if len(word) > 4:
	word.remove(',')
	word.remove(' ')
print(len(word) - 2)


(s, a, k) = (input(), [], 0)
for c in s:
	if c.isalpha() and c not in a:
		a.append(c)
		k += 1
print(k)


def main():
	print(len({i for i in input() if i not in [',', '{', '}', ' ']}))
main()


s = input()
myset = set()
for x in s:
	if x.isalpha():
		myset.add(x)
print(len(myset))


n = input()
l = n[1:len(n) - 1]
p = l.split(', ')
k = set(p)
k = list(k)
if k[0] == '':
	print('0')
else:
	print(len(k))


word = str(input())
n = len(word)
line = word[1:n - 1]
list1 = [str(k) for k in line.split(', ')]
list1 = list(set(list1))
n = len(list1)
if list1[0] == '':
	n = 0
print(n)


a = set(input())
result = len(a) - 2
if ' ' in a:
	result = result - 1
if ',' in a:
	result = result - 1
print(result)


import sys
from random import choice, randint
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def MI():
	return map(int, sys.stdin.readline().strip().split())

def LI():
	return list(map(int, sys.stdin.readline().strip().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines().strip()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().strip().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().strip().split()]

def LS():
	return sys.stdin.readline().strip().split()

def I():
	return int(sys.stdin.readline().strip())

def F():
	return float(sys.stdin.readline().strip())

def S():
	return sys.stdin.readline().strip()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))
inp = sys.stdin.readline
out = sys.stdout.write

def main():
	s = S()[1:-1].split(', ')
	if '' in s:
		s.remove('')
	print(len(set(s)))
main()


ar = input()
ar = ar.strip(',')
arr = list(ar)
arr.sort()
c = 0
for i in range(len(arr)):
	if arr[i] != '{' and arr[i] != '}' and (arr[i] != ',') and (arr[i] != ' '):
		if arr[i] != arr[i - 1]:
			c += 1
print(c)


c = str(input())
d = []
if len(c) > 0 and c != '{}':
	for i in range(1, len(c), 3):
		d.append(c[i])
	a = sorted(d)
	output = 0
	for j in range(len(d) - 1):
		if a[j] == a[j + 1]:
			output += 0
		else:
			output += 1
	print(output + 1 if len(d) > 0 else 0)
else:
	print(0)


lista = input()
resposta = ''
if lista == '{}':
	print(0)
else:
	for i in range(1, len(lista) - 1):
		resposta += lista[i]
	resposta = resposta.split(', ')
	resposta.sort()
	contador = 0
	for i in range(len(resposta) - 1):
		if resposta[i] != resposta[i + 1]:
			contador += 1
	print(contador + 1)


a = input()
b = set()
for i in a:
	if i.isalpha() and i not in b:
		b.add(i)
print(len(b))


import collections
from collections import OrderedDict
s = input()
st = s.replace(' ', '').replace(',', '').replace('{', '').replace('}', '')
t = ''.join(sorted(st))
str = ''.join(OrderedDict.fromkeys(t))
c = 0
for i in range(0, len(str)):
	c = c + 1
print(c)


s = input()
c = [0] * 200
count = 0
for i in s:
	i = ord(i)
	if 97 <= i <= 122:
		if c[i] == 0:
			c[i] += 1
			count += 1
print(count)


S = input()[1:-1]
if S != '':
	print(len(set(S.split(', '))))
else:
	print(0)


s = input()
l = len(s)
s = list(s[1:l - 1].split(', '))
D = {}
for i in s:
	D[i] = 1
if len(D) == 1 and '' in D:
	print(0)
else:
	print(len(D))


word = input()
word = word[1:-1].split(', ')
ans = set(word)
ans.discard('')
print(len(ans))


s = []
for i in input():
	if i == '{' or i == '}' or i == ' ' or (i == ','):
		continue
	if i not in s:
		s.append(i)
print(str(len(s)))


x = input()
b = x[1:-1]
if len(b) != 0:
	c = list(b.split(', '))
	y = []
	for i in c:
		if i in y:
			continue
		else:
			y.append(i)
	print(len(y))
else:
	print(0)


def check(a):
	b = ''
	for i in a.split('{')[1].split('}')[0].split(','):
		try:
			b += i.split()[0]
		except:
			pass
	return len(set(b))
a = input()
print(check(a))


s = input()
ar = []
for i in s:
	if ord(i) >= 97 and ord(i) <= 122:
		if i not in ar:
			ar.append(i)
print(len(ar))


while True:
	ch = input()
	if len(ch) <= 1000:
		break
ch = ch.replace('{', '')
ch = ch.replace('}', '')
ch = ch.replace(', ', '')
ch_set = set(ch)
print(len(ch_set))


inp = input()[1:-1].split(', ')
if '' in inp:
	inp.remove('')
print(len(set(inp)))


s = input()
k = len(s)
a = s[1:k - 1]
b = list(a.split(', '))
c = set(b)
if s == '{}':
	print('0')
else:
	print(len(c))


l = input()[1:-1].split(', ')
if l == ['']:
	print('0')
else:
	l.sort()
	n = 0
	for i in range(len(l) - 1):
		if not l[i] == l[i + 1]:
			n = n + 1
	print(n + 1)


a = input()[1:-1]
b = set(a)
b.discard(',')
b.discard(' ')
print(len(b))


letters = input()
letters = letters.rstrip('}')
letters = letters.lstrip('{')
letters = letters.split(',')
for l in letters:
	letters[letters.index(l)] = l.lstrip()
if letters == ['']:
	print(0)
else:
	print(len(set(letters)))


count = 0
a = input()
result = []
for c in a:
	if c not in result:
		result.append(c)
result = ''.join(result)
for i in range(0, len(result)):
	if result[i] >= 'a' and result[i] <= 'z':
		count += 1
print(count)


a = str(input())
d = a[1:-1]
b = d.split(', ')
if len(a) == 2:
	print('0')
else:
	x = list(set(b))
	print(len(x))


text = input()
elements = text[1:-1].split(sep=',')
elements = [x.rstrip().lstrip() for x in elements]
var = set()
for each in elements:
	if each is not '':
		var.add(each)
print(len(var))


raw = input()
raw = str.split(raw[1:len(raw) - 1], ', ')
aux = []
for i in raw:
	if i not in aux:
		aux.append(i)
if len(aux) == 1 and aux[0] == '':
	print(0)
else:
	print(len(aux))


S = list(input())
line = []
if len(S) != 2:
	for i in range(int(len(S) / 3)):
		line.append(S[3 * i + 1])
	line = list(set(line))
	print('{}'.format(len(line)))
else:
	print('0')


n = input()
m = ''
for i in n:
	if i not in '{},':
		m = m + i
import re
k = set(re.split(' ', m))
if m == '' or m == ' ':
	print(0)
else:
	print(len(k))


s = input()
y = s[1:-1]
z = set(y.split(', '))
if s == '{}':
	print(0)
	exit()
print(len(z))


arr = input()[1:-1].split(', ')
n = 0
ul = []
if arr == ['']:
	print(0)
	quit()
for i in arr:
	if not i in ul:
		ul.append(i)
		n += 1
print(n)


s = input()
charset = set()
for i in s:
	if i.isalnum():
		charset.add(i)
count = 0
for i in charset:
	count += 1
print(count)


st = input()
se_t = set()
for s in st:
	if s != ',' and s != '{' and (s != '}') and (s != ' '):
		se_t.add(s)
print(len(se_t))


n = input()
s = n.replace(' ', '')
l = s[1:-1:1].split(',')
c = []
for x in l:
	if x not in c:
		c.append(x)
if c[0] == '':
	c = []
print(len(c))


line = input()
line = line.lstrip('{')
line = line.rstrip('}')
line = line.replace(',', ' ')
list1 = line.split()
a = set(list1)
print(len(a))


z = str(input())
s = set()
for i in z:
	if i.isalpha():
		s.add(i)
print(len(s))


import math
import os
import sys
import re
import itertools
import functools
import operator
s = input()
if s == '{}':
	print(0)
	quit()
print(len(set(s[1:-1].split(', '))))