#include<bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
//freopen("input.txt", "r", stdin);
int n; cin >> n;
for(int i = 0; i < n; i++){
int L1 = 0, L2 = 0;
string s; cin >> s;
for(int i = 0; s[i] != '\0'; i++){
for(int j = i; s[j] != '\0'; j++){
string sub = s.substr(i, j - i + 1);
if(sub == "SUVO")
L1++;
if(sub == "SUVOJIT")
L2++;
}
}
//SUVO = 0, SUVOJIT = 1
cout << "SUVO = " << L1 - L2 << ", SUVOJIT = " << L2 << "\n";
}
return 0;
}
Language: C++17