#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<stack>
#include<vector>
using namespace std;
int main()
{
int a,k=0;
char d[100];
cin>>a;
while(a--)
{
k=0;
scanf("%s",d);
if(strlen(d)==5)
{
cout<<"3\n";
}
if(strlen(d)==3)
{
if(d[0]!='o') k++;
if(d[1]!='n') k++;
if(d[2]!='e') k++;
if(k==1||k==0)
{
cout<<"1\n";
}
if(k>1)
{
cout<<"2\n";
}
}
}
}