| <p>Alfredo Spaghetti really likes soup, especially when it contains alphabet |
| pasta. Every day he constructs a sentence from letters, places the letters into |
| a bowl of broth and enjoys delicious alphabet soup. |
| </p> |
|
|
| <p>Today, after constructing the sentence, Alfredo remembered that the Facebook |
| Hacker Cup starts today! Thus, he decided to construct the phrase "HACKERCUP". |
| As he already added the letters to the broth, he is stuck with the letters he |
| originally selected. Help Alfredo determine how many times he can |
| place the word "HACKERCUP" side-by-side using the letters in his soup. |
| </p> |
|
|
| <h3>Input</h3> |
|
|
| <p>The first line of the input file contains a single integer T: the number of |
| test cases. T lines follow, each representing a single test case with a sequence |
| of upper-case letters and spaces: the original sentence Alfredo constructed. |
| </p> |
|
|
| <h3>Output</h3> |
|
|
| <p>Output T lines, one for each test case. For each case, output "Case #t: n", |
| where t is the test case number (starting from 1) and n is the number of times |
| the word "HACKERCUP" can be placed side-by-side using the letters from the |
| sentence. |
| </p> |
|
|
| <h3>Constraints</h3> |
|
|
| <ul> |
| <li> 1 < T ≤ 20 |
| <li> Sentences contain only the upper-case letters A-Z and the space character |
| <li> Each sentence contains at least one letter, and contains at most 1,000 |
| characters, including spaces |
| </ul> |
|
|
|
|