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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#include<bits/stdc++.h>

using namespace std;

string s;
long long n, answ;
int odw[200010];
long long it;

bool chck(char c)
{
    if(c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' || c == 'y' ) return true;
    return false;
}

long long artm(long long x)
{
    return ( (x+1)*x )/2;
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cin >> s;
    n = s.size();
    for(int i = 0; i<n-2; i++)
    {
        if(chck(s[i]) && chck(s[i+1]) && chck(s[i+2]) )
        {
            odw[i] = 1; odw[i+1] = 1; odw[i+2] = 1;
        }
        if(!chck(s[i]) && !chck(s[i+1]) && !chck(s[i+2]))
        {
            odw[i] = 2; odw[i+1] = 2; odw[i+2] = 2;
        }
    }
    answ = artm(n);
    if(odw[0] != 0) it = 2;
    for(int i = 0; i<n; i++)
    {
        if(odw[i] == 0)
        {
            it++;
        }
        if(odw[i]!=0 && i == 0 )
        {
            answ-=3;
            continue;
        }
        if(odw[i]!=0 && odw[i-1] == 0 )
        {
            answ-=artm(it+2);
            it = 2;
        }
        if(odw[i] != 0 && odw[i-1] != 0 && odw[i]!=odw[i-1] )
        {
            answ-=10;
        }
    }
    if(odw[n-1] == 0)
        answ-=artm(it);
    else
        answ-=3;
    it = 0;
    for(int i = 0; i<n; i++)
    {
        if(odw[i] != 0)it++;
        if(odw[i+1] != odw[i] && odw[i] != 0)
        {
            answ-=2*it-7;
            it = 0;
        }
    }
    cout << answ;
}