import java.io.*;

public class MatrizAsociativa {
    public static void main(String[] args) {
        // TODO code application logic here
        int c[] = new int['z'-'a'+1];
        char car; //subindice
        final char eof = (char)-1; //end of file
        
        //DATOS Y TABLA DE FRECUENCIAS
        System.out.println("Introduce an text");
        System.out.println("To end the process, please enter [Ctrl]+[Z]");
        
        try {
            while ((car = (char)System.in.read())!=eof) {                
                if (car>='a'&&car<='z') {
                    c[car-'a']++;
                }
            }
        } catch (IOException ignorada) {}
        
        //Show table of frequency
        System.out.println("\n");
        //Display a header 'a b c ... n'
        for (car = 'a'; car <= 'z'; car++) {
            System.out.println(" "+car);
            System.out.println("\n --------------------------------------"+
                    "----------------------------------");
        }
        //Display the frequency of how many times a character has appear
        for (car = 'a'; car<='z'; car++) {
            System.out.println(" "+c[car-'a']);
            System.out.println();
        }
    }
}