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
78
79
80
#include <iostream>
#include<vector>
using namespace std;

int main(){
ios_base::sync_with_stdio(0);
string a;
vector <bool> b;
cin >> a;
int n=a.size();
b.resize(n,0);
for (int i =0; i<n;i++){
    if (a[i]=='a'||a[i]=='e'||a[i]=='i'||a[i]=='o'||a[i]=='u'||a[i]=='y'){
        b[i]=1;
    }
}
/*for (int i=0; i<n;i++){
    cout << b[i];
}
cout << endl;*/
long long wynik=0;
int tmp=0;
int tmp2=0;
bool czek=0;
int t[n];
t[0]=0;
t[1]=0;
if (n>2){
for (int i=2; i<n;i++){
    int tmp=0;
    int tmp2=0;
    for (int j=0; j<3;j++){
        if (b[i-j]){
            tmp++;
            tmp2=0;
        }else{
            tmp2++;
            tmp=0;
        }
    }
    if (tmp==3 || tmp2==3){
        t[i]=t[i-1]+1;
    }else{
    t[i]=t[i-1];
    }
}
/*for (int i=0; i<n;i++){
    cout << t[i];
}
cout << endl;*/
int tmp3=-1;
int t2[n];
int t3[n];
for (int i=n-1; i>0;i--){
    if (t[i-1]!=t[i]){
        tmp3=i;
    }
    t2[i]=tmp3;
}
for (int i=0;i+2<n;i++){
    t3[i]=t2[i+2];
}
/*for (int i=0; i<n;i++){
    cout << t2[i]<<" ";
}
cout << endl;
for (int i=0; i<n;i++){
    cout << t3[i]<<" ";
}
cout << endl;*/
for (int i=0; i+2<n ;i++){
int b=t3[i];
    if (t[b]==t[i+1]+1){
    wynik+=n-b;
    }
    //cout <<i<<" "<< b<<" "<<n-b<<endl;
}
}
cout << wynik<<endl;
}