num=input()
l=[]
n=len(num)
for i in range(n):
if 0 <= ord(num[i]) <= 127:
l.append(num[i])
else:
continue
b=set(l)
print(len(b))
num=input()
l=[]
n=len(num)
for i in range(n):
if 0 <= ord(num[i]) <= 127:
l.append(num[i])
else:
continue
b=set(l)
print(len(b))