import java.util.*;
import java.io.*;
public class CountWords {
static public void main(String[] args) {
HashSet words = new HashSet();
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String delim = " \t\n.,:;?!-/()[]\"\'";
String line;
int count = 0;
try {
while ((line = in.readLine()) != null) {
StringTokenizer st = new StringTokenizer(line, delim);
while (st.hasMoreTokens()) {
count++;
words.add(st.nextToken().toLowerCase());
}
}
} catch (IOException e) {}
System.out.println("Total number of words: " + count);
System.out.println("Number of different words: " + words.size());
}
}