Problem J
ilove Strings
It’s that time of year when love is in the air. You’re no stranger to love. You are obsessed with strings but not just any strings. You love “ilove” Strings. An “ilove” String is a string of length 5 with the following properties:
-
Alternates between vowels (excluding ‘y’ and ‘Y’) and consonants (including ‘y’ and ‘Y’)
-
Begins with a vowel (excluding ‘y’ and ‘Y’)
-
Consists of
pairwise distinct characters (distinguishing between upper and lower case)
Examples of “ilove” Strings includes “ilove”, “image”, “IxoXO”, and “abide”. Examples of non-“ilove” Strings include , “ideas”, “maker”, “inane”, “oxOXo” and “abides”.
The loveliness of a string is the number of subsequences of
the string that form an “ilove” String. Although “ilooove” is not an “ilove” String, it does have
a loveliness of
Input
Input contains a single string of between
Output
For the provided string, print one line with a single
integer
Sample Input 1 | Sample Output 1 |
---|---|
ilovestrings |
4 |
Sample Input 2 | Sample Output 2 |
---|---|
idont |
0 |
Sample Input 3 | Sample Output 3 |
---|---|
CAPital |
1 |