1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <cstdio>
#include <cstring>

bool IS_VOWEL[256] = {0};

bool is_unspeakable(char a, char b, char c) {
    return (IS_VOWEL[a] && IS_VOWEL[b] && IS_VOWEL[c]) || (!IS_VOWEL[a] && !IS_VOWEL[b] && !IS_VOWEL[c]);
}

int main() {
    char text[300000];
    unsigned long long n;
    unsigned long long result = 0;
    unsigned long long last = 0;
    
    IS_VOWEL['a'] = true;
    IS_VOWEL['e'] = true;
    IS_VOWEL['i'] = true;
    IS_VOWEL['o'] = true;
    IS_VOWEL['u'] = true;
    IS_VOWEL['y'] = true;

    scanf("%s", text);
    n = strlen(text);
    
    for(unsigned long long i = 1; text[i + 1]; i++) {
        if (is_unspeakable(text[i - 1], text[i], text[i + 1])) {
            result += (i - last) * (n - (i + 1));
            last = i;
        }
    }

    printf("%lld\n", result);
}