#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*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdin;
int main() {
  char mas[] = {1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3, 1,
                2, 3, 1, 2, 3, 4, 1, 2, 3, 1, 2, 3, 4};
  char c, c1, buf[160];
  int i, j;
  fgets(buf, 160, stdin);
  j = 0;
  i = 0;
  while (buf[j] != '\0' && buf[j] != 0x0d) {
    c = buf[j];
    if (c != 0x20) {
      c = c - 97;
      if (c >= 0 && c <= 26) {
        i = i + mas[c];
      }
    } else
      i++;
    j++;
  };
  printf("%d", i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xebe(%rip),%ax
mov    %ax,-0x8(%rbp)
lea    -0xd0(%rbp),%rdi
mov    0x2e7c(%rip),%rax
mov    (%rax),%edx
mov    $0xa0,%esi
call   1040 <fgets@plt>
movl   $0x0,-0xd8(%rbp)
movl   $0x0,-0xd4(%rbp)
movslq -0xd8(%rbp),%rax
movsbl -0xd0(%rbp,%rax,1),%ecx
ff
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd9(%rbp)
je     11c7 <main+0xa7>
movslq -0xd8(%rbp),%rax
movsbl -0xd0(%rbp,%rax,1),%eax
ff
cmp    $0xd,%eax
setne  %al
mov    %al,-0xd9(%rbp)
mov    -0xd9(%rbp),%al
test   $0x1,%al
jne    11da <main+0xba>
jmp    125c <main+0x13c>
movslq -0xd8(%rbp),%rax
mov    -0xd0(%rbp,%rax,1),%al
mov    %al,-0x21(%rbp)
movsbl -0x21(%rbp),%eax
cmp    $0x20,%eax
je     1239 <main+0x119>
movsbl -0x21(%rbp),%eax
sub    $0x61,%eax
mov    %al,-0x21(%rbp)
movsbl -0x21(%rbp),%eax
cmp    $0x0,%eax
jl     1234 <main+0x114>
movsbl -0x21(%rbp),%eax
cmp    $0x1a,%eax
jg     1234 <main+0x114>
mov    -0xd4(%rbp),%eax
movsbq -0x21(%rbp),%rcx
movsbl -0x20(%rbp,%rcx,1),%ecx
add    %ecx,%eax
mov    %eax,-0xd4(%rbp)
jmp    1248 <main+0x128>
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
mov    -0xd8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd8(%rbp)
jmp    118c <main+0x6c>
mov    -0xd4(%rbp),%esi
lea    0xdb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xa0,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0xa0,%esi
call   1040 <fgets@plt>
xor    %esi,%esi
lea    0xeb6(%rip),%rax
jmp    1157 <main+0x37>
nopl   0x0(%rax)
add    $0x1,%esi
add    $0x1,%rbx
movzbl (%rbx),%ecx
cmp    $0x20,%cl
je     1150 <main+0x30>
test   %cl,%cl
je     117f <main+0x5f>
cmp    $0xd,%cl
je     117f <main+0x5f>
add    $0x9f,%cl
cmp    $0x1a,%cl
ja     1153 <main+0x33>
movzbl %cl,%ecx
movsbl (%rcx,%rax,1),%ecx
add    %ecx,%esi
add    $0x1,%rbx
jmp    1157 <main+0x37>
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.mas = [26 x i8] c"\01\02\03\01\02\03\01\02\03\01\02\03\01\02\03\01\02\03\04\01\02\03\01\02\03\04"
@stdin = global i32 0
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [26 x i8]
%3 = alloca i8
%4 = alloca i8
%5 = alloca [160 x i8]
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = bitcast [26 x i8]* %2 to i8*
%9 = getelementptr inbounds [160 x i8], [160 x i8]* %5, i64 0, i64 0
%10 = load i32, i32* @stdin
%11 = call i32 @fgets(i8* %9, i32 160, i32 %10)
store i32 0, i32* %7
store i32 0, i32* %6
br label %12
12: ; preds = %60, %0
%13 = load i32, i32* %7
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [160 x i8], [160 x i8]* %5, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %26
19: ; preds = %12
%20 = load i32, i32* %7
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [160 x i8], [160 x i8]* %5, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp ne i32 %24, 13
br label %26
26: ; preds = %19, %12
%27 = phi i1 [ false, %12 ], [ %25, %19 ]
br i1 %27, label %28, label %63
28: ; preds = %26
%29 = load i32, i32* %7
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [160 x i8], [160 x i8]* %5, i64 0, i64 %30
%32 = load i8, i8* %31
store i8 %32, i8* %3
%33 = load i8, i8* %3
%34 = sext i8 %33 to i32
%35 = icmp ne i32 %34, 32
br i1 %35, label %36, label %57
36: ; preds = %28
%37 = load i8, i8* %3
%38 = sext i8 %37 to i32
%39 = sub nsw i32 %38, 97
%40 = trunc i32 %39 to i8
store i8 %40, i8* %3
%41 = load i8, i8* %3
%42 = sext i8 %41 to i32
%43 = icmp sge i32 %42, 0
br i1 %43, label %44, label %56
44: ; preds = %36
%45 = load i8, i8* %3
%46 = sext i8 %45 to i32
%47 = icmp sle i32 %46, 26
br i1 %47, label %48, label %56
48: ; preds = %44
%49 = load i32, i32* %6
%50 = load i8, i8* %3
%51 = sext i8 %50 to i64
%52 = getelementptr inbounds [26 x i8], [26 x i8]* %2, i64 0, i64 %51
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
%55 = add nsw i32 %49, %54
store i32 %55, i32* %6
br label %56
56: ; preds = %48, %44, %36
br label %60
57: ; preds = %28
%58 = load i32, i32* %6
%59 = add nsw i32 %58, 1
store i32 %59, i32* %6
br label %60
60: ; preds = %57, %56
%61 = load i32, i32* %7
%62 = add nsw i32 %61, 1
store i32 %62, i32* %7
br label %12
63: ; preds = %26
%64 = load i32, i32* %6
%65 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %64)
ret i32 0
}

LLVM IR (-O2):
@__const.main.mas = [26 x i8] c"\01\02\03\01\02\03\01\02\03\01\02\03\01\02\03\01\02\03\04\01\02\03\01\02\03\04"
@stdin = global i32 0
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [160 x i8]
%2 = getelementptr inbounds [160 x i8], [160 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @fgets(i8* %2, i32 160, i32 %3)
br label %5
5: ; preds = %21, %0
%6 = phi i64 [ %23, %21 ], [ 0, %0 ]
%7 = phi i32 [ %22, %21 ], [ 0, %0 ]
%8 = getelementptr inbounds [160 x i8], [160 x i8]* %1, i64 0, i64 %6
%9 = load i8, i8* %8
switch i8 %9, label %10 [
i8 0, label %24
i8 13, label %24
i8 32, label %19
]
10: ; preds = %5
%11 = add i8 %9, -97
%12 = icmp ult i8 %11, 27
br i1 %12, label %13, label %21
13: ; preds = %10
%14 = zext i8 %11 to i64
%15 = getelementptr inbounds [26 x i8], [26 x i8]* @__const.main.mas, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = add nsw i32 %7, %17
br label %21
19: ; preds = %5
%20 = add nsw i32 %7, 1
br label %21
21: ; preds = %10, %13, %19
%22 = phi i32 [ %18, %13 ], [ %7, %10 ], [ %20, %19 ]
%23 = add nuw i64 %6, 1
br label %5
24: ; preds = %5, %5
%25 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}