#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 */
scalar_t__ EOF;
scalar_t__ fgetc(int /*<<< orphan*/);
scalar_t__ is_triangle(int);
int /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, char *);
int /*<<< orphan*/ stdin;
char tolower(char);
int main(void) {
  char word[100 + 1];
  int count = 0;
  while (scanf("\"%100[^\"]\"", word) > 0) {
    int word_value = 0;
    for (int i = 0; word[i] != 0; i++)
      word_value += tolower(word[i]) - 'a' + 1;
    if (is_triangle(word_value))
      count++;
    if (fgetc(stdin) == EOF)
      break;
  }
  printf("%d\n", count);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x74(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xe8c(%rip),%rdi
call   1070 <scanf@plt>
cmp    $0x0,%rax
jle    1211 <main+0xc1>
movl   $0x0,-0x78(%rbp)
movl   $0x0,-0x7c(%rbp)
movslq -0x7c(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     11ce <main+0x7e>
movslq -0x7c(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%edi
call   1060 <tolower@plt>
movsbl %al,%eax
sub    $0x61,%eax
add    $0x1,%eax
add    -0x78(%rbp),%eax
mov    %eax,-0x78(%rbp)
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    1191 <main+0x41>
mov    -0x78(%rbp),%edi
call   1030 <is_triangle@plt>
cmp    $0x0,%rax
je     11e9 <main+0x99>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
mov    0x2df8(%rip),%rax
mov    (%rax),%edi
call   1050 <fgetc@plt>
mov    0x2de2(%rip),%rcx
cmp    (%rcx),%rax
jne    120c <main+0xbc>
jmp    1211 <main+0xc1>
jmp    1169 <main+0x19>
mov    -0x74(%rbp),%esi
lea    0xdf0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
xor    %ebp,%ebp
lea    0xe99(%rip),%r14
mov    %rsp,%r15
mov    0x2e6f(%rip),%r12
jmp    11a2 <main+0x52>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <is_triangle@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%ebp
mov    0x2e53(%rip),%rax
mov    (%rax),%edi
call   1050 <fgetc@plt>
cmp    (%r12),%rax
je     11df <main+0x8f>
mov    %r14,%rdi
mov    %r15,%rsi
call   1070 <scanf@plt>
test   %rax,%rax
jle    11df <main+0x8f>
mov    (%rsp),%al
xor    %ebx,%ebx
test   %al,%al
je     1180 <main+0x30>
lea    0x1(%rsp),%r13
movsbl %al,%edi
call   1060 <tolower@plt>
movsbl %al,%eax
add    %eax,%ebx
add    $0xffffffa0,%ebx
movzbl 0x0(%r13),%eax
add    $0x1,%r13
test   %al,%al
jne    11c0 <main+0x70>
jmp    1180 <main+0x30>
lea    0xe25(%rip),%rdi
mov    %ebp,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"\22%100[^\22]\22\00"
@stdin = global i32 0
@EOF = global i64 0
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [101 x i8]
%2 = getelementptr inbounds [101 x i8], [101 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %10, %0
%4 = phi i32 [ 0, %0 ], [ %15, %10 ]
%5 = call i64 @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %2)
%6 = icmp sgt i64 %5, 0
br i1 %6, label %7, label %32
7: ; preds = %3
%8 = load i8, i8* %2
%9 = icmp eq i8 %8, 0
br i1 %9, label %10, label %20
10: ; preds = %20, %7
%11 = phi i32 [ 0, %7 ], [ %27, %20 ]
%12 = call i64 @is_triangle(i32 %11)
%13 = icmp ne i64 %12, 0
%14 = zext i1 %13 to i32
%15 = add nuw nsw i32 %4, %14
%16 = load i32, i32* @stdin
%17 = call i64 @fgetc(i32 %16)
%18 = load i64, i64* @EOF
%19 = icmp eq i64 %17, %18
br i1 %19, label %32, label %3
20: ; preds = %7, %20
%21 = phi i64 [ %28, %20 ], [ 0, %7 ]
%22 = phi i8 [ %30, %20 ], [ %8, %7 ]
%23 = phi i32 [ %27, %20 ], [ 0, %7 ]
%24 = call signext i8 @tolower(i8 signext %22)
%25 = sext i8 %24 to i32
%26 = add i32 %23, -96
%27 = add i32 %26, %25
%28 = add nuw i64 %21, 1
%29 = getelementptr inbounds [101 x i8], [101 x i8]* %1, i64 0, i64 %28
%30 = load i8, i8* %29
%31 = icmp eq i8 %30, 0
br i1 %31, label %10, label %20
32: ; preds = %10, %3
%33 = phi i32 [ %15, %10 ], [ %4, %3 ]
%34 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %33)
ret i32 0
}