#P7541. Pleasant Word Replacement
Pleasant Word Replacement
Pleasant Word Replacement
Lea wrote a word and then replaced some of its letters with underscores ('_'). Afterwards, she will replace each underscore with an uppercase letter. The resulting word is called pleasant if it satisfies the following conditions:
- The word does not contain three or more consecutive vowels.
- The word does not contain three or more consecutive consonants.
- The word contains at least one uppercase letter
L
.
Note: The set of vowels is defined as \( \{a,e,i,o,u\} \) (only lowercase letters). All other letters (including uppercase letters, even if they would be vowels in usual English) are considered consonants.
Your task is to determine in how many ways Lea can replace the underscores with uppercase letters (from A to Z) such that the resulting word is pleasant.
You can assume that the given word consists only of English letters and underscores.
inputFormat
The input consists of a single line containing a non-empty string \( s \) (with length up to, say, 100) made up of English letters and underscores.
outputFormat
Output a single integer, representing the number of ways to replace all underscores with uppercase letters such that the final word is pleasant.
sample
L
1