Super easy problems indeed. Simple if statements required.
import java.io.PrintWriter;
import java.util.Scanner;
/**
*
* @author Sanchit M. Bhatnagar
* @see http://uhunt.felix-halim.net/id/74004
*
*/
public class P12289 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
PrintWriter out = new PrintWriter(System.out);
int N = sc.nextInt();
while (N > 0) {
String input = sc.next();
if (input.length() == 5) {
out.println("3");
} else {
if ((input.charAt(0) == 'o' && input.charAt(1) == 'n') || (input.charAt(0) == 'o' && input.charAt(2) == 'e') || (input.charAt(1) == 'n' && input.charAt(2) == 'e')) {
out.println("1");
} else {
out.println("2");
}
}
N--;
}
out.close();
sc.close();
}
}