Dobby's English Study

Time limit1sMemory limit128 MB

Summary
For each line, count how many times a given letter (case-insensitive) appears in a sentence until a line with only '#' ends input.
Level

Easy1 of 10

Topics
String, Implementation
Solved
No attempts yet

Problem

Kkung decided to teach Dobby English so that Dobby could live freely. Since Dobby still needs to learn the alphabet, Kkung gives Dobby an English sentence and one lowercase letter, then asks how many times that letter appears in the sentence.

Count the letter regardless of case: uppercase and lowercase forms of the same alphabet letter are counted together. Write a program that prints the answer for each question.

Input

The input consists of several lines.

Each line contains one lowercase letter, one space, and an English sentence whose length is between 1 and 250, inclusive.

The last line of input contains only #.

Output

For each input line, print the given lowercase letter and the number of times that alphabet letter appears in the sentence.

Count letters without distinguishing uppercase from lowercase.

Examples1

  1. Example 1

    Input
    g Programming Contest
    n New Zealand
    x This is quite a simple problem.
    #
    
    Expected output
    g 2
    n 2
    x 0