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
35
36
37
38
39
40
41
42
43
44
45
#include <bits/stdc++.h>

using namespace std;

const int N = 2e5+10;
char s[N];

bool is(char c)
{
    if(c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' || c == 'y')
        return 1;
    return 0;
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

	int n, i, l=-1, ile1=0, ile2=0;
    long long wyn=0;
    char c;
    cin >> s;
    n = strlen(s);
    
    ile1 = is(s[0]) + is(s[1]);
    ile2 = !is(s[0]) + !is(s[1]);
    for(i=2; i<n; i++)
    {
        ile1 += is(s[i]);
        ile2 += !is(s[i]);
        //cout << ile1 << ' ' << ile2 << ' ' << s[i] << '\n';
        if(ile1 == 3 || ile2 == 3)
        {
            wyn += (i-l-2)*(n-i);
            //cout << wyn << '\n';
            l = i-2;
        }
        ile1 -= is(s[i-2]);
        ile2 -= !is(s[i-2]);
    }
    cout << wyn << '\n';
    return 0;
}