Problem C
Hickory Dickory Doc
Hickory Dickory Doc.
The mice ran up the clock.
The clock struck one,
and the rest escaped with minor injuries.
Hickory Dickory Doc.
An accounting of the injuries was made at the doc’s office the next day. As the doc (named Hickory Dickory, of course) saw each mouse, he wrote down words like “paws”, “tail”, “nose”, “ears”; he did not note which mouse had which injuries, nor how many mice there were. That will be your task to determine!
As for the clock, the police showed up, ordered the clock to keep his hands up, bound him with ticker tape, and hauled him off to jail. The jury declared him guilty, and the judge sentenced him to swing. At that point, his heart stopped short, never to tick again!
Input
You will be given the doctor’s list; he has helpfully recorded the total number of injuries on the first line. Each type of observed injured body part per mouse is presented on a separate line. If the word is plural, it naturally means more than one, such as “paws” could mean 2 to 4 paws, “eyes” would mean 2 eyes, etc. Possible words are “nose”, “eye”, “eyes”, “ear”, “ears”, “tail”, “paw”, and “paws”. The ordering is random as the mice jostled for attention and could get selected randomly to display additional injuries, though no injured body part is counted more than once. The doctor writes down the injury(ies) presented to him as they are presented and does not go back to update what was previously written to make things plural (e.g. if two paws were shown, each at different times). There will be at most $100$ reports of injuries.
Output
Format as in the sample. Print the smallest possible number of mice treated by the doc that day. If it is possible that it was just one mouse, please use the word mouse instead of mice. For Sample 1 on the next page, there were 8 entries. "paw" + "paws" + "paws" implies at least 5 paws, thus at least 2 mice. "tail" + "tail" + "tail" implies at least 3 mice. Similarly, there is 1 eye and 2 ears which could be from the same mouse. The fewest number of mice is therefore 3.
| Sample Input 1 | Sample Output 1 |
|---|---|
8 paw paws eye tail ears tail paws tail |
3 mice |
| Sample Input 2 | Sample Output 2 |
|---|---|
7 eye ears nose eye paw tail paws |
1 mouse |
