#include<stdio.h>
#include<string.h>
#include <iostream>
#include <string>
using namespace std;
int main()
{
char str1[]={"one"},str3[10];
int i,j,n,l,flog=0;
while(scanf("%d",&n)!=EOF)
{
getchar();
for(i=1;i<=n;i++)
{
flog=0;
gets(str3);
l=strlen(str3);
if(l==5)
printf("3\n");
else if(l==3)
{
for(j=0;j<=2;j++)
{
if(str1[j]==str3[j])
flog++;
}
if(flog>=2)
printf("1\n");
else printf("2\n");
}
}
}
}
#include<string.h>
#include <iostream>
#include <string>
using namespace std;
int main()
{
char str1[]={"one"},str3[10];
int i,j,n,l,flog=0;
while(scanf("%d",&n)!=EOF)
{
getchar();
for(i=1;i<=n;i++)
{
flog=0;
gets(str3);
l=strlen(str3);
if(l==5)
printf("3\n");
else if(l==3)
{
for(j=0;j<=2;j++)
{
if(str1[j]==str3[j])
flog++;
}
if(flog>=2)
printf("1\n");
else printf("2\n");
}
}
}
}