import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Set;
import java.util.TreeSet;
public class Main {
private static boolean isLetter(char c) {
return ('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z');
}
while (reader.ready()) {
StringBuilder currentWord = new StringBuilder();
boolean wasLetter = false;
String currentLine
= reader.
readLine(); int lengthLine = currentLine.length();
for (int i = 0; i < lengthLine; ++i) {
if (isLetter(currentLine.charAt(i))) {
currentWord.append(currentLine.charAt(i));
wasLetter = true;
} else if (wasLetter) {
uniqueWords.add(currentWord.toString());
currentWord = new StringBuilder();
wasLetter = false;
}
}
if (currentWord.length() != 0) {
uniqueWords.add(currentWord.toString());
}
}
}
Set<String> uniqueWords = new TreeSet<>();
parseToWords(reader, uniqueWords);
System.
out.
println(uniqueWords.
size()); }
}
aW1wb3J0IGphdmEuaW8uQnVmZmVyZWRSZWFkZXI7CmltcG9ydCBqYXZhLmlvLklPRXhjZXB0aW9uOwppbXBvcnQgamF2YS5pby5JbnB1dFN0cmVhbVJlYWRlcjsKaW1wb3J0IGphdmEudXRpbC5TZXQ7CmltcG9ydCBqYXZhLnV0aWwuVHJlZVNldDsKCnB1YmxpYyBjbGFzcyBNYWluIHsKICAgIHByaXZhdGUgc3RhdGljIGJvb2xlYW4gaXNMZXR0ZXIoY2hhciBjKSB7CiAgICAgICAgcmV0dXJuICgnQScgPD0gYyAmJiBjIDw9ICdaJykgfHwgKCdhJyA8PSBjICYmIGMgPD0gJ3onKTsKICAgIH0KCiAgICBwcml2YXRlIHN0YXRpYyB2b2lkIHBhcnNlVG9Xb3JkcyhCdWZmZXJlZFJlYWRlciByZWFkZXIsIFNldDxTdHJpbmc+IHVuaXF1ZVdvcmRzKSB0aHJvd3MgSU9FeGNlcHRpb24gewogICAgICAgIHdoaWxlIChyZWFkZXIucmVhZHkoKSkgewogICAgICAgICAgICBTdHJpbmdCdWlsZGVyIGN1cnJlbnRXb3JkID0gbmV3IFN0cmluZ0J1aWxkZXIoKTsKICAgICAgICAgICAgYm9vbGVhbiB3YXNMZXR0ZXIgPSBmYWxzZTsKICAgICAgICAgICAgU3RyaW5nIGN1cnJlbnRMaW5lID0gcmVhZGVyLnJlYWRMaW5lKCk7CiAgICAgICAgICAgIGludCBsZW5ndGhMaW5lID0gY3VycmVudExpbmUubGVuZ3RoKCk7CiAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbGVuZ3RoTGluZTsgKytpKSB7CiAgICAgICAgICAgICAgICBpZiAoaXNMZXR0ZXIoY3VycmVudExpbmUuY2hhckF0KGkpKSkgewogICAgICAgICAgICAgICAgICAgIGN1cnJlbnRXb3JkLmFwcGVuZChjdXJyZW50TGluZS5jaGFyQXQoaSkpOwogICAgICAgICAgICAgICAgICAgIHdhc0xldHRlciA9IHRydWU7CiAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHdhc0xldHRlcikgewogICAgICAgICAgICAgICAgICAgIHVuaXF1ZVdvcmRzLmFkZChjdXJyZW50V29yZC50b1N0cmluZygpKTsKICAgICAgICAgICAgICAgICAgICBjdXJyZW50V29yZCA9IG5ldyBTdHJpbmdCdWlsZGVyKCk7CiAgICAgICAgICAgICAgICAgICAgd2FzTGV0dGVyID0gZmFsc2U7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaWYgKGN1cnJlbnRXb3JkLmxlbmd0aCgpICE9IDApIHsKICAgICAgICAgICAgICAgIHVuaXF1ZVdvcmRzLmFkZChjdXJyZW50V29yZC50b1N0cmluZygpKTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0KCiAgICBwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmdbXSBhcmdzKSB0aHJvd3MgSU9FeGNlcHRpb24gewogICAgICAgIEJ1ZmZlcmVkUmVhZGVyIHJlYWRlciA9IG5ldyBCdWZmZXJlZFJlYWRlcihuZXcgSW5wdXRTdHJlYW1SZWFkZXIoU3lzdGVtLmluKSk7CiAgICAgICAgU2V0PFN0cmluZz4gdW5pcXVlV29yZHMgPSBuZXcgVHJlZVNldDw+KCk7CiAgICAgICAgcGFyc2VUb1dvcmRzKHJlYWRlciwgdW5pcXVlV29yZHMpOwogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbih1bmlxdWVXb3Jkcy5zaXplKCkpOwogICAgfQp9