Problem:
Counting Characters

Write a program which counts and reports the number of each alphabetical letter. Ignore the case of characters.

Input

A sentence in English is given in several lines.

Output

Prints the number of alphabetical letters in the following format:

a : The number of 'a'
b : The number of 'b'
c : The number of 'c'
.
.
z : The number of 'z'

Constraints

The number of characters in the sentence < 1200

Sample Input

This is a pen.

Sample Output

a : 1
b : 0
c : 0
d : 0
e : 1
f : 0
g : 0
h : 1
i : 2
j : 0
k : 0
l : 0
m : 0
n : 1
o : 0
p : 1
q : 0
r : 0
s : 2
t : 1
u : 0
v : 0
w : 0
x : 0
y : 0
z : 0

Solution in JAVA (judge verdict: Wrong Answer)

import java.util.Scanner;

public class Main {
 
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        int n,i,count[]=new int[26];
        String str="",str1,strnull=null,eng="abcdefghijklmnopqrstuvwxyz";
        char c;
        while(true){
            str1 = scan.next();
            System.out.println(str);
            if(scan.hasNext()==false)break;
            str+=str1;
        }
        str=str.toLowerCase();
        n=str.length();
        for(i=0;i<26;i++) {
            count[i]=0;
        }
        for(i=0;i<n;i++) {
            c=str.charAt(i);
            switch(c) {
                case 'a':
                    count[0]++;
                    break;
                case 'b':
                    count[1]++;
                    break;
                case 'c':
                    count[2]++;
                    break;
                case 'd':
                    count[3]++;
                    break;
                case 'e':
                    count[4]++;
                    break;
                case 'f':
                    count[5]++;
                    break;
                case 'g':
                    count[6]++;
                    break;
                case 'h':
                    count[7]++;
                    break;
                case 'i':
                    count[8]++;
                    break;
                case 'j':
                    count[9]++;
                    break;
                case 'k':
                    count[10]++;
                    break;
                case 'l':
                    count[11]++;
                    break;
                case 'm':
                    count[12]++;
                    break;
                case 'n':
                    count[13]++;
                    break;
                case 'o':
                    count[14]++;
                    break;
                case 'p':
                    count[15]++;
                    break;
                case 'q':
                    count[16]++;
                    break;
                case 'r':
                    count[17]++;
                    break;
                case 's':
                    count[18]++;
                    break;
                case 't':
                    count[19]++;
                    break;
                case 'u':
                    count[20]++;
                    break;
                case 'v':
                    count[21]++;
                    break;
                case 'w':
                    count[22]++;
                    break;
                case 'x':
                    count[23]++;
                    break;
                case 'y':
                    count[24]++;
                    break;
                case 'z':
                    count[25]++;
                    break;
                default:
                    break;
            }
        }
        for(i=0;i<26;i++) {
            System.out.println(eng.charAt(i)+" : "+count[i]);
        }
    }
}