#55427: c++ - > 只管y就好


61247091s@gapps.ntnu.edu.tw (wei)


#include <bits/stdc++.h>
using namespace std;

int main(){
    string s;
    while(cin>>s){
        int total=0,yee=0;
        for(int i=0;i<s.size();i++){
            if(s[i]=='y'){
                total+=abs(i-yee);
                yee+=3;
               
            }
        }
        cout<<total<<endl;
    }
    return 0;
}