import java.util.*;
public class Main {
public static void main(String args[]){
Scanner in = new Scanner(System.in);
while(in.hasNext()){
String str = in.next();
char arr[] = str.toCharArray();
int sum=0,a=0;
for(int i=0;i<arr.length;i++){
if(arr[i] == 'y'){
sum+=Math.abs(i-a);
a+=3;
}
}
System.out.println(sum);
}
}
}
import java.util.*;
public class Main {
public static void main(String args[]){
Scanner in = new Scanner(System.in);
while(in.hasNext()){
String str = in.next();
char arr[] = str.toCharArray();
int sum=0,a=0;
for(int i=0;i<arr.length;i++){
if(arr[i] == 'y'){
sum+=Math.abs(i-a);
a+=3;
}
}
System.out.println(sum);
}
}
}
稍微排版了一下