//Regional Hands On Problem 1, suggested solution
// Need to import Scanner, IOException, and FileNotFoundException
import java.util.*;
import java.io.*;

public class count{
	
	public static void main(String[] args) throws IOException{
		
		Scanner input = new Scanner(new File("count.in"));
		int[] freqs = new int[26];
		
		int numLine = input.nextInt();
		input.nextLine();
		for(int line = 0; line < numLine; line++){
			String s = input.nextLine().toLowerCase();
			for(int j = 0; j < s.length(); j++){
				char c = s.charAt(j);
				if( Character.isLetter(c)){
						 // I know c is a letter
						// increment the correct frequency
					freqs[c - 'a']++;
				}
			}
		}
		
		//ready to output results
		for(int i = 0; i < 26; i++)
			System.out.println( (char)(i + 'a') + " " + freqs[i]);
	}
}
