12289

#include <iostream>

#include <string>
#include <vector>
#include <string.h>

using namespace std;

int main()
{
int n;
string str;
cin>>n;
while(n--)
{
cin>>str;
if(str.size()==5)
{
cout<<"3"<<"\n";
continue;
}
int cnt=0;

if(str[0]=='o'|| str[0]=='n' || str[0]=='e')
{
cnt++;
}
if((str[1]=='o'|| str[1]=='n' || str[1]=='e') && str[1]!=str[0])
{
cnt++;
}
if((str[2]=='o'|| str[2]=='n' || str[2]=='e') && str[1]!=str[2] && str[2]!=str[0])
{
cnt++;
}

if(cnt>=2)
{
cout<<"1"<<"\n";
continue;
}
cnt=0;
if(str[0]=='t'|| str[0]=='w' || str[0]=='o')
{
cnt++;
}
if((str[1]=='t'|| str[1]=='w' || str[1]=='o') && str[1]!=str[0])
{
cnt++;
}
if((str[2]=='t'|| str[2]=='w' || str[2]=='o')&& str[1]!=str[2] && str[2]!=str[0])
{
cnt++;
}

if(cnt>=2)
{
cout<<"2"<<"\n";
continue;
}
}

return 0;
}

 

Leave a Reply

Your email address will not be published. Required fields are marked *