| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 512 MB | 42 | 34 | 20 | 71.429% |
Haiku --- is a type of short form poetry originally from Japan. Traditional haiku consist of three phrases that contains 17ドル$ phonetic units. First 5ドル$ of them are on the first line, next 7ドル$ of them are on the second line, and the last 5ドル$ on the last line.
You have found a big text about haiku. However, there were no line breaks in it. You have already broken the text into words and now you want to find all potential haiku in it: segments of consecutive words that can form a haiku.
For simplicity, the following conventions are adopted in this problem. A word is a sequence of lowercase letters of the English alphabet. A phonetic unit is a sequence of consecutive vowels. Vowels are the letters "a", "e", "i", "o" and "u". For example, the word "contest" contains two phonetic units, and the word "beautiful" contains three of them.
The problem is to find the number of segments of consecutive words, which, if two line breaks are added to them after any two words, would form a haiku.
For example, there are two potential haiku in the text "if the real beauties of sunset in a suspended moment call for the thunder forever":
the real beauties of
sunset in a suspended
moment call for the
and
beauties of sunset
in a suspended moment
call for the thunder
The first line of inpit contains integer $n$ --- the number of words in text that you have found (1ドル \le n \le {10}^5$). The next $n$ lines contain words of lowercase letters. The length of each word does not exceed 20ドル$. It is guaranteed that each word contains at least one phonetic unit.
Output the number of potential haiku in this text.
15 if the real beauties of sunset in a suspended moment call for the thunder forever
2