Hide

Problem A
The Apaxians Strike Back

Researchers at the Oriental Institute have spent all summer analyzing a collection of Apaxian scrolls unearthed, of all places, on the shores of Lake Michigan. Once again, the Oriental Institute has turned to the Department of Computer Science to analyze the ancients texts of this venerable civilization that we totally did not make up.

More specifically, the linguists and archaeologists of the Oriental Institute have discovered a twist in the Apaxian naming system. It seems that, in Apaxian society, the first letter in your name, and how many times that letter appears in your name, was crucial in determining social status. Thus, an Apaxian named axeziolotenimos would have belonged to the lower castes of society (the letter a only appears once in his name), while bobabeeboobabibobuboo was renowned and admired throughout the entire Apaxian Empire (the first letter of his name, b, appears several times in his name).

The Oriental Institute has sent us a list of common Apaxian names, and has asked us to determine how important the name is, based on how many times the first letter of the name appears in the name (including the first letter). For example, for alexitas, the letter a appears 2 times. For bobabeeboobabibobuboo, the letter b appears 9 times.

Input

The input contains a single name. Each name contains only lowercase letters, no whitespace, and has a maximum length of 50 characters.

Output

The output contains a single integer: the number of times the first letter of the name appears in the name (including the first letter).

Sample Input 1 Sample Output 1
axeziolotenimos
1
Sample Input 2 Sample Output 2
alexitas
2
Sample Input 3 Sample Output 3
bobabeeboobabibobuboo
9

Please log in to submit a solution to this problem

Log in