#include #include #include #include #include using namespace std; const int N = 100100; char s[N]; int main () { // freopen ("in.txt", "r", stdin); int T; cin >> T; while (T--) { scanf ("%s", s + 1); int n = strlen (s + 1), res = 0; for (int i = 1; i <= n; i++) { for (int j = i + i; j <= n; j += i) if (j % i == 0) { int k = j * j / i; if (k > n) break; if (s[i] == 'y' && s[j] == 'r' && s[k] == 'x' || s[k] == 'y' && s[j] == 'r' && s[i] == 'x') res++; } } cout << res << endl; } }