#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);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
int main() {
  char input_string[160];
  int counter, counter_clicks = 0;
  scanf("%[^\n]s", input_string);
  for (counter = 0; counter < strlen(input_string); counter++) {
    switch (input_string[counter]) {
    case 'a':
    case 'd':
    case 'g':
    case 'j':
    case 'm':
    case 'p':
    case 't':
    case 'w':
    case ' ':
      counter_clicks = counter_clicks + 1;
      break;
    case 'b':
    case 'e':
    case 'h':
    case 'k':
    case 'n':
    case 'q':
    case 'u':
    case 'x':
      counter_clicks = counter_clicks + 2;
      break;
    case 'c':
    case 'f':
    case 'i':
    case 'l':
    case 'o':
    case 'r':
    case 'v':
    case 'y':
      counter_clicks = counter_clicks + 3;
      break;
    case 's':
    case 'z':
      counter_clicks = counter_clicks + 4;
      break;
    }
  }
  printf("%d", counter_clicks);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xb8(%rbp)
lea    -0xb0(%rbp),%rsi
lea    0x1012(%rip),%rdi
call   1050 <scanf@plt>
movl   $0x0,-0xb4(%rbp)
mov    -0xb4(%rbp),%eax
mov    %eax,-0xbc(%rbp)
lea    -0xb0(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0xbc(%rbp),%eax
cmp    %ecx,%eax
jge    1230 <main+0x100>
movslq -0xb4(%rbp),%rax
movsbl -0xb0(%rbp,%rax,1),%eax
ff
add    $0xffffffe0,%eax
mov    %eax,%ecx
mov    %rcx,-0xc8(%rbp)
sub    $0x5a,%eax
ja     1217 <main+0xe7>
mov    -0xc8(%rbp),%rax
lea    0xe3d(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0xb8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb8(%rbp)
jmp    1217 <main+0xe7>
mov    -0xb8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xb8(%rbp)
jmp    1217 <main+0xe7>
mov    -0xb8(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0xb8(%rbp)
jmp    1217 <main+0xe7>
mov    -0xb8(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0xb8(%rbp)
jmp    121c <main+0xec>
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb4(%rbp)
jmp    1169 <main+0x39>
mov    -0xb8(%rbp),%esi
lea    0xf36(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0xa8,%rsp
lea    0x1028(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    11aa <main+0x7a>
xor    %ebx,%ebx
mov    %rsp,%r14
lea    0xe99(%rip),%r15
xor    %ebp,%ebp
jmp    1186 <main+0x56>
nopl   0x0(%rax,%rax,1)
add    $0x3,%ebp
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jge    11ac <main+0x7c>
movsbl (%rsp,%rbx,1),%eax
add    $0xffffffe0,%eax
cmp    $0x5a,%eax
ja     1173 <main+0x43>
movslq (%r15,%rax,4),%rax
add    %r15,%rax
jmp    *%rax
add    $0x1,%ebp
jmp    1173 <main+0x43>
add    $0x2,%ebp
jmp    1173 <main+0x43>
add    $0x4,%ebp
jmp    1173 <main+0x43>
xor    %ebp,%ebp
lea    0xfc0(%rip),%rdi
mov    %ebp,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xa8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%[^\0A]s\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [160 x i8]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
%5 = getelementptr inbounds [160 x i8], [160 x i8]* %2, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %5)
store i32 0, i32* %3
br label %7
7: ; preds = %31, %0
%8 = load i32, i32* %3
%9 = getelementptr inbounds [160 x i8], [160 x i8]* %2, i64 0, i64 0
%10 = call i32 @strlen(i8* %9)
%11 = icmp slt i32 %8, %10
br i1 %11, label %12, label %34
12: ; preds = %7
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [160 x i8], [160 x i8]* %2, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
switch i32 %17, label %30 [
i32 97, label %18
i32 100, label %18
i32 103, label %18
i32 106, label %18
i32 109, label %18
i32 112, label %18
i32 116, label %18
i32 119, label %18
i32 32, label %18
i32 98, label %21
i32 101, label %21
i32 104, label %21
i32 107, label %21
i32 110, label %21
i32 113, label %21
i32 117, label %21
i32 120, label %21
i32 99, label %24
i32 102, label %24
i32 105, label %24
i32 108, label %24
i32 111, label %24
i32 114, label %24
i32 118, label %24
i32 121, label %24
i32 115, label %27
i32 122, label %27
]
18: ; preds = %12, %12, %12, %12, %12, %12, %12, %12, %12
%19 = load i32, i32* %4
%20 = add nsw i32 %19, 1
store i32 %20, i32* %4
br label %30
21: ; preds = %12, %12, %12, %12, %12, %12, %12, %12
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 2
store i32 %23, i32* %4
br label %30
24: ; preds = %12, %12, %12, %12, %12, %12, %12, %12
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 3
store i32 %26, i32* %4
br label %30
27: ; preds = %12, %12
%28 = load i32, i32* %4
%29 = add nsw i32 %28, 4
store i32 %29, i32* %4
br label %30
30: ; preds = %12, %27, %24, %21, %18
br label %31
31: ; preds = %30
%32 = load i32, i32* %3
%33 = add nsw i32 %32, 1
store i32 %33, i32* %3
br label %7
34: ; preds = %7
%35 = load i32, i32* %4
%36 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %35)
%37 = load i32, i32* %1
ret i32 %37
}

LLVM IR (-O2):
@.str = [7 x i8] c"%[^\0A]s\00"
@.str.1 = [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 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @strlen(i8* %2)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %26
6: ; preds = %0, %20
%7 = phi i64 [ %22, %20 ], [ 0, %0 ]
%8 = phi i32 [ %21, %20 ], [ 0, %0 ]
%9 = getelementptr inbounds [160 x i8], [160 x i8]* %1, i64 0, i64 %7
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
switch i32 %11, label %20 [
i32 97, label %12
i32 100, label %12
i32 103, label %12
i32 106, label %12
i32 109, label %12
i32 112, label %12
i32 116, label %12
i32 119, label %12
i32 32, label %12
i32 98, label %14
i32 101, label %14
i32 104, label %14
i32 107, label %14
i32 110, label %14
i32 113, label %14
i32 117, label %14
i32 120, label %14
i32 99, label %16
i32 102, label %16
i32 105, label %16
i32 108, label %16
i32 111, label %16
i32 114, label %16
i32 118, label %16
i32 121, label %16
i32 115, label %18
i32 122, label %18
]
12: ; preds = %6, %6, %6, %6, %6, %6, %6, %6, %6
%13 = add nsw i32 %8, 1
br label %20
14: ; preds = %6, %6, %6, %6, %6, %6, %6, %6
%15 = add nsw i32 %8, 2
br label %20
16: ; preds = %6, %6, %6, %6, %6, %6, %6, %6
%17 = add nsw i32 %8, 3
br label %20
18: ; preds = %6, %6
%19 = add nsw i32 %8, 4
br label %20
20: ; preds = %12, %14, %16, %18, %6
%21 = phi i32 [ %8, %6 ], [ %19, %18 ], [ %17, %16 ], [ %15, %14 ], [ %13, %12 ]
%22 = add nuw nsw i64 %7, 1
%23 = call i32 @strlen(i8* %2)
%24 = sext i32 %23 to i64
%25 = icmp slt i64 %22, %24
br i1 %25, label %6, label %26
26: ; preds = %20, %0
%27 = phi i32 [ 0, %0 ], [ %21, %20 ]
%28 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %27)
ret i32 0
}