// Arup Guha
// 2/27/2016
// Program that counts letter frequencies from a file.
// Written in Junior Knights

import java.util.*;
import java.io.*;

public class CountLetters {

	public static void main(String[] args) throws Exception {

		// Get one word.
		Scanner stdin = new Scanner(System.in);
		System.out.println("Please enter the file you want to examine.");
		String filename = stdin.next();
		Scanner fin = new Scanner(new File(filename));

		// Tally up frequencies of each letter.
		int[] freq = new int[26];

		// Keep on reading until there are no more tokens.
		while (fin.hasNext()) {

            // Read in and make sure all letters are uppercase.
			String word = fin.next();
			word = word.toUpperCase();

			// Go through each letter, screening out non-letters, adjusting
			// frequencies of letters as necessary.
			for (int i=0; i<word.length(); i++) {
				if (Character.isLetter(word.charAt(i)))
					freq[word.charAt(i)-'A']++;
			}
		}

		// Print out a chart of all frequencies.
		for (int i=0; i<26; i++) {
			System.out.println(((char)('A'+i)) +"\t"+freq[i]);
		}

        // Close the file.
		fin.close();
	}
}
