import java.util.*; 
import java.io.*; 

public class WordFrequency2 {
  static public void main(String[] args) {
    //TreeMap words = new TreeMap(new StringComparator()); 
    TreeMap words = new TreeMap(); 
    String delim = " \t\n.,:;?!-/()[]\"\'";
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); 
    String line, word;
    Count count; 
    try {
      while ((line = in.readLine()) != null) {
	StringTokenizer st = new StringTokenizer(line, delim); 
	while (st.hasMoreTokens()) {
	  word = st.nextToken().toLowerCase(); 
	  if (words.containsKey(word)) {
	    count = (Count) words.get(word); 
	    count.i++; 
	  } else {
	    words.put(word, new Count(word, 1)); 
	  }
	}
      } 
    } catch (IOException e) {}
    
    Set set = words.entrySet(); 
    Iterator iter = set.iterator(); 
    while (iter.hasNext()) {
      Map.Entry entry = (Map.Entry) iter.next(); 
      word = (String) entry.getKey();
      count = (Count) entry.getValue(); 
      System.out.println(word + 
			 (word.length() < 8 ? "\t\t" : "\t") + 
			 count.i); 
    }

  }

  static class Count {
    Count(String word, int i) {
      this.word = word; 
      this.i = i; 
    }

    String word; 
    int i; 
  }
}