#include #include #include #define MAX 10010 #define init(x,y) memset(x,y,sizeof(x)) using namespace std; int n, m, i, j, k, t,len,ans; char str[MAX]; int judge(int i,int j,int k){ if (str[i] == 'y'&&str[j] == 'r'&&str[k] == 'x'){ return 1; } return 0; } int cal(){ for (int i = 1; i < len; i++){ for (int j = 1; i*j*j < len;j++){ if (judge(i, i*j, i*j*j)) ans++; if (judge(i*j*j, i*j, i)) ans++; } } return 0; } int main(){ scanf("%d", &t); while (t--){ ans = 0; len = 1; scanf("%s", str+1); while (str[len] != 0){ len++; } cal(); printf("%d\n", ans); } return 0; }