#!/bin/python
with open("input", "r") as input:
sum = 0
answers = set()
for line in input:
line = line.strip()
if line == "":
sum += len(answers)
for char in line:
answers.add(char)
print(sum)