#include<iostream>
#include <string>
using namespace std;
int main(){
string x;
while (getline(cin, x)) {
int count=0;
int flag=0;
for (int i=0; i<x.length(); i++) {
int k=(unsigned)x.find("y", i);
if (k!=string::npos) { //如果有找到y
i=k;
count+=abs(k-flag);
flag+=3;
}
}
cout<<count<<endl;
}
return 0;
}