import java.util.*;
import java.io.*;

public class CuentaWF  {
	SortedMap sm;
	public CuentaWF(String fich)  {
		trae(fich);
	}
	
	public CuentaWF(BufferedReader br)  throws IOException {
		trae(br);
	}
	
	private void trae(String fich)  {
		try  {
			BufferedReader br = new BufferedReader(new FileReader(fich));
			trae(br);
			br.close();
		} catch (IOException e)  {
			System.out.println("Error de E/S");
		}
	}
	
	private void trae(BufferedReader br)  throws IOException {
		sm = new TreeMap();
		StringTokenizer st;
		String linea = br.readLine();
		while (linea!=null)  {
			st = new StringTokenizer(linea," .,:;()\t");
			while (st.hasMoreTokens())  {
				String palabra = st.nextToken();
				Integer iv = (Integer)sm.get(palabra);
				sm.put(palabra,iv==null?new Integer(1):new Integer(iv.intValue()+1));
			}
			linea = br.readLine();
		}
	}

//	public void salida(String s)  {
//		try {
//			PrintWriter pw = new PrintWriter(new FileWriter(s),true);
//			salida(pw);
//			pw.close();
//		} catch (IOException e)  {
//			System.out.println("Error de E/S");
//		}
//	} 
//					
//	public void salida(PrintWriter pw)  {
//		SortedSet ss = sm.getEntry();
//		Iterator it = ss.iteartor();
//		while (it.hasMore())  {
//		pw.println("Jugadas: "+nveces);
//		for(int i=0;i<6;i++)
//			pw.println((i+1)+" -> "+jugadas[i]);
//	}

	public SortedMap sm()  {
		return sm;
	} 	
}

					