#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, ...);
int strlen(char *);
int main() {
  int testCase;
  scanf("%d", &testCase);
  while (testCase--) {
    char a[10];
    scanf("%s", a);
    if (strlen(a) == 5)
      printf("3\n");
    else {
      int cnt = 0;
      if (a[0] == 'o')
        cnt++;
      if (a[1] == 'n')
        cnt++;
      if (a[2] == 'e')
        cnt++;
      if (cnt >= 2)
        printf("1\n");
      else
        printf("2\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x0,%eax
je     1214 <main+0xe4>
lea    -0x12(%rbp),%rsi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    -0x12(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x5,%eax
jne    119a <main+0x6a>
lea    0xe76(%rip),%rdi
call   1040 <printf@plt>
jmp    120f <main+0xdf>
movl   $0x0,-0x18(%rbp)
movsbl -0x12(%rbp),%eax
cmp    $0x6f,%eax
jne    11b7 <main+0x87>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
movsbl -0x11(%rbp),%eax
cmp    $0x6e,%eax
jne    11cd <main+0x9d>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
movsbl -0x10(%rbp),%eax
cmp    $0x65,%eax
jne    11e3 <main+0xb3>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x2,-0x18(%rbp)
jl     11fe <main+0xce>
lea    0xe15(%rip),%rdi
call   1040 <printf@plt>
jmp    120a <main+0xda>
lea    0xe07(%rip),%rdi
call   1040 <printf@plt>
jmp    120f <main+0xdf>
jmp    1151 <main+0x21>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xebc(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
subl   $0x1,(%rsp)
jae    1164 <main+0x34>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
lea    0xe98(%rip),%r14
lea    0x6(%rsp),%rbx
lea    0xe93(%rip),%r15
lea    0xe8a(%rip),%r12
lea    0xe81(%rip),%r13
jmp    119b <main+0x6b>
nopw   0x0(%rax,%rax,1)
call   1030 <puts@plt>
subl   $0x1,(%rsp)
jb     1154 <main+0x24>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %r15,%rdi
cmp    $0x5,%eax
je     1190 <main+0x60>
xor    %eax,%eax
cmpb   $0x6f,0x6(%rsp)
sete   %al
lea    0x1(%rax),%ecx
cmpb   $0x6e,0x7(%rsp)
cmovne %eax,%ecx
xor    %eax,%eax
cmpb   $0x65,0x8(%rsp)
sete   %al
add    %ecx,%eax
mov    %r12,%rdi
cmp    $0x2,%eax
jae    1190 <main+0x60>
mov    %r13,%rdi
jmp    1190 <main+0x60>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [3 x i8] c"3\0A\00"
@.str.3 = [3 x i8] c"1\0A\00"
@.str.4 = [3 x i8] c"2\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10 x i8]
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
br label %6
6: ; preds = %50, %0
%7 = load i32, i32* %2
%8 = add nsw i32 %7, -1
store i32 %8, i32* %2
%9 = icmp ne i32 %7, 0
br i1 %9, label %10, label %51
10: ; preds = %6
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%14 = call i32 @strlen(i8* %13)
%15 = icmp eq i32 %14, 5
br i1 %15, label %16, label %18
16: ; preds = %10
%17 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %50
18: ; preds = %10
store i32 0, i32* %4
%19 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 111
br i1 %22, label %23, label %26
23: ; preds = %18
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %26
26: ; preds = %23, %18
%27 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 1
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 110
br i1 %30, label %31, label %34
31: ; preds = %26
%32 = load i32, i32* %4
%33 = add nsw i32 %32, 1
store i32 %33, i32* %4
br label %34
34: ; preds = %31, %26
%35 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 2
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = icmp eq i32 %37, 101
br i1 %38, label %39, label %42
39: ; preds = %34
%40 = load i32, i32* %4
%41 = add nsw i32 %40, 1
store i32 %41, i32* %4
br label %42
42: ; preds = %39, %34
%43 = load i32, i32* %4
%44 = icmp sge i32 %43, 2
br i1 %44, label %45, label %47
45: ; preds = %42
%46 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
br label %49
47: ; preds = %42
%48 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %49
49: ; preds = %47, %45
br label %50
50: ; preds = %49, %16
br label %6
51: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"%s\00"
@str = [2 x i8] c"2\00"
@str.5 = [2 x i8] c"1\00"
@str.6 = [2 x i8] c"3\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = bitcast i32* %1 to i8*
%4 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = add nsw i32 %5, -1
store i32 %6, i32* %1
%7 = icmp eq i32 %5, 0
br i1 %7, label %36, label %8
8: ; preds = %0
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 1
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 2
br label %12
12: ; preds = %8, %30
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%14 = call i32 @strlen(i8* %9)
%15 = icmp eq i32 %14, 5
br i1 %15, label %30, label %16
16: ; preds = %12
%17 = load i8, i8* %9
%18 = icmp eq i8 %17, 111
%19 = zext i1 %18 to i32
%20 = load i8, i8* %10
%21 = icmp eq i8 %20, 110
%22 = select i1 %18, i32 2, i32 1
%23 = select i1 %21, i32 %22, i32 %19
%24 = load i8, i8* %11
%25 = icmp eq i8 %24, 101
%26 = zext i1 %25 to i32
%27 = add nuw nsw i32 %23, %26
%28 = icmp ugt i32 %27, 1
%29 = select i1 %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0)
br label %30
30: ; preds = %16, %12
%31 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @str.6, i64 0, i64 0), %12 ], [ %29, %16 ]
%32 = call i32 @puts(i8* dereferenceable(1) %31)
%33 = load i32, i32* %1
%34 = add nsw i32 %33, -1
store i32 %34, i32* %1
%35 = icmp eq i32 %33, 0
br i1 %35, label %36, label %12
36: ; preds = %30, %0
ret i32 0
}