#32813: _ans


yp11151049@yphs.tp.edu.tw (901-26李文睿)


#include<bits/stdc++.h>
using namespace std;
int main(){
    ios::sync_with_stdio(false);
    string s;
    while(cin>>s){
        int p=0,ans=0;
        for(int i=0;i<s.length();i++)
        if(s[i]=='y') {ans+=abs(i-p); p+=3;}
        cout<<ans<<'\n';
    }
}