#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*/ getchar();
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int strlen(char *);
int main() {
  int len, n;
  char a[12];
  scanf("%d", &n);
  getchar();
  while (n--) {
    gets(a);
    len = strlen(a);
    if (len == 3) {
      if ((a[0] == 'o' && a[1] == 'n') || (a[0] == 'o' && a[2] == 'e') ||
          (a[1] == 'n' && a[2] == 'e')) {
        printf("1\n");
      } else {
        printf("2\n");
      }
    } else if (len == 5) {
      printf("3\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1070 <scanf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     1239 <main+0xe9>
lea    -0x18(%rbp),%rdi
call   1060 <gets@plt>
lea    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    1219 <main+0xc9>
movsbl -0x18(%rbp),%eax
cmp    $0x6f,%eax
jne    11c3 <main+0x73>
movsbl -0x17(%rbp),%eax
cmp    $0x6e,%eax
je     11f7 <main+0xa7>
movsbl -0x18(%rbp),%eax
cmp    $0x6f,%eax
jne    11dd <main+0x8d>
movsbl -0x16(%rbp),%eax
cmp    $0x65,%eax
je     11f7 <main+0xa7>
movsbl -0x17(%rbp),%eax
cmp    $0x6e,%eax
jne    1208 <main+0xb8>
movsbl -0x16(%rbp),%eax
cmp    $0x65,%eax
jne    1208 <main+0xb8>
lea    0xe05(%rip),%rdi
call   1040 <printf@plt>
jmp    1214 <main+0xc4>
lea    0xdf7(%rip),%rdi
call   1040 <printf@plt>
jmp    1234 <main+0xe4>
cmpl   $0x5,-0x8(%rbp)
jne    122f <main+0xdf>
lea    0xddf(%rip),%rdi
call   1040 <printf@plt>
jmp    1234 <main+0xe4>
jmp    1176 <main+0x26>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xe9e(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1070 <scanf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
subl   $0x1,0x8(%rsp)
jae    1188 <main+0x38>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
lea    0xc(%rsp),%rbx
lea    0xe6f(%rip),%r14
lea    0xe6c(%rip),%r15
lea    0xe63(%rip),%r12
jmp    11cc <main+0x7c>
xor    $0x65,%cl
xor    $0x6e,%al
or     %cl,%al
mov    %r12,%rdi
cmove  %r15,%rdi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
call   1030 <puts@plt>
subl   $0x1,0x8(%rsp)
jb     117a <main+0x2a>
mov    %rbx,%rdi
call   1060 <gets@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %r14,%rdi
cmp    $0x5,%eax
je     11c0 <main+0x70>
cmp    $0x3,%eax
jne    11c5 <main+0x75>
movzbl 0xc(%rsp),%edx
movzbl 0xd(%rsp),%eax
cmp    $0x6f,%dl
jne    11ff <main+0xaf>
mov    %r15,%rdi
cmp    $0x6e,%al
je     11c0 <main+0x70>
movzbl 0xe(%rsp),%ecx
cmp    $0x6f,%dl
jne    11a4 <main+0x54>
mov    %r15,%rdi
cmp    $0x65,%cl
je     11c0 <main+0x70>
jmp    11a4 <main+0x54>

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

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