#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 *, ...);
int /*<<< orphan*/ strcmp(char *, char *);
int main() {
  int n;
  int answer = 0;
  char next_str[13];
  scanf("%d\n", &n);
  for (int i = 0; i < n; i++) {
    if (i != n - 1)
      scanf("%12s\n", next_str);
    else
      scanf("%12s", next_str);
    if (!strcmp(next_str, "Tetrahedron"))
      answer += 4;
    else if (!strcmp(next_str, "Cube"))
      answer += 6;
    else if (!strcmp(next_str, "Octahedron"))
      answer += 8;
    else if (!strcmp(next_str, "Dodecahedron"))
      answer += 12;
    else if (!strcmp(next_str, "Icosahedron"))
      answer += 20;
  }
  printf("%d\n", answer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0xeb3(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    128a <main+0x15a>
mov    -0x20(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     1193 <main+0x63>
lea    -0x19(%rbp),%rsi
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
jmp    11a5 <main+0x75>
lea    -0x19(%rbp),%rsi
lea    0xe6c(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    -0x19(%rbp),%rdi
lea    0xe5f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11cc <main+0x9c>
mov    -0xc(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0xc(%rbp)
jmp    1277 <main+0x147>
lea    -0x19(%rbp),%rdi
lea    0xe44(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11f3 <main+0xc3>
mov    -0xc(%rbp),%eax
add    $0x6,%eax
mov    %eax,-0xc(%rbp)
jmp    1272 <main+0x142>
lea    -0x19(%rbp),%rdi
lea    0xe22(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    121a <main+0xea>
mov    -0xc(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0xc(%rbp)
jmp    126d <main+0x13d>
lea    -0x19(%rbp),%rdi
lea    0xe06(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1241 <main+0x111>
mov    -0xc(%rbp),%eax
add    $0xc,%eax
mov    %eax,-0xc(%rbp)
jmp    1268 <main+0x138>
lea    -0x19(%rbp),%rdi
lea    0xdec(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1263 <main+0x133>
mov    -0xc(%rbp),%eax
add    $0x14,%eax
mov    %eax,-0xc(%rbp)
jmp    1268 <main+0x138>
jmp    126d <main+0x13d>
jmp    1272 <main+0x142>
jmp    1277 <main+0x147>
jmp    127c <main+0x14c>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    115f <main+0x2f>
mov    -0xc(%rbp),%esi
lea    0xd6c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xecb(%rip),%rdi
xor    %ebx,%ebx
lea    0x14(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x14(%rsp),%eax
test   %eax,%eax
jle    1268 <main+0x148>
movabs $0x6465686172746554,%r15
68 65 64
movabs $0x6e6f7264656861,%rbp
lea    0xea0(%rip),%r13
lea    0x7(%rsp),%r14
xor    %r12d,%r12d
xor    %ebx,%ebx
jmp    1194 <main+0x74>
cs nopw 0x0(%rax,%rax,1)
add    $0x4,%ebx
add    $0x1,%r12d
mov    0x14(%rsp),%eax
cmp    %eax,%r12d
jge    1268 <main+0x148>
add    $0xffffffff,%eax
mov    %r13,%rdi
cmp    %eax,%r12d
je     11a6 <main+0x86>
lea    0xe5e(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x7(%rsp),%rax
xor    %r15,%rax
mov    0xf(%rsp),%ecx
xor    $0x6e6f72,%rcx
or     %rax,%rcx
je     1180 <main+0x60>
mov    0x7(%rsp),%eax
mov    $0x65627543,%ecx
xor    %ecx,%eax
movzbl 0xb(%rsp),%ecx
or     %eax,%ecx
je     1250 <main+0x130>
mov    0x7(%rsp),%rax
movabs $0x726465686174634f,%rcx
65 64 72
xor    %rcx,%rax
mov    0xa(%rsp),%rcx
xor    %rbp,%rcx
or     %rax,%rcx
je     1258 <main+0x138>
mov    0x7(%rsp),%rax
movabs $0x6568616365646f44,%rcx
61 68 65
xor    %rcx,%rax
mov    0xc(%rsp),%rcx
xor    %rbp,%rcx
or     %rax,%rcx
je     1260 <main+0x140>
lea    0xfafdf5(%r15),%rax
xor    0x7(%rsp),%rax
mov    0xf(%rsp),%ecx
xor    $0x6e6f72,%rcx
lea    0x14(%rbx),%edx
or     %rax,%rcx
cmovne %ebx,%edx
mov    %edx,%ebx
jmp    1183 <main+0x63>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x6,%ebx
jmp    1183 <main+0x63>
add    $0x8,%ebx
jmp    1183 <main+0x63>
add    $0xc,%ebx
jmp    1183 <main+0x63>
lea    0xd91(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [6 x i8] c"%12s\0A\00"
@.str.2 = [5 x i8] c"%12s\00"
@.str.3 = [12 x i8] c"Tetrahedron\00"
@.str.4 = [5 x i8] c"Cube\00"
@.str.5 = [11 x i8] c"Octahedron\00"
@.str.6 = [13 x i8] c"Dodecahedron\00"
@.str.7 = [12 x i8] c"Icosahedron\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [13 x i8]
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %2)
store i32 0, i32* %5
br label %7
7: ; preds = %62, %0
%8 = load i32, i32* %5
%9 = load i32, i32* %2
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %65
11: ; preds = %7
%12 = load i32, i32* %5
%13 = load i32, i32* %2
%14 = sub nsw i32 %13, 1
%15 = icmp ne i32 %12, %14
br i1 %15, label %16, label %19
16: ; preds = %11
%17 = getelementptr inbounds [13 x i8], [13 x i8]* %4, i64 0, i64 0
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %17)
br label %22
19: ; preds = %11
%20 = getelementptr inbounds [13 x i8], [13 x i8]* %4, i64 0, i64 0
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* %20)
br label %22
22: ; preds = %19, %16
%23 = getelementptr inbounds [13 x i8], [13 x i8]* %4, i64 0, i64 0
%24 = call i32 @strcmp(i8* %23, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%25 = icmp ne i32 %24, 0
br i1 %25, label %29, label %26
26: ; preds = %22
%27 = load i32, i32* %3
%28 = add nsw i32 %27, 4
store i32 %28, i32* %3
br label %61
29: ; preds = %22
%30 = getelementptr inbounds [13 x i8], [13 x i8]* %4, i64 0, i64 0
%31 = call i32 @strcmp(i8* %30, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%32 = icmp ne i32 %31, 0
br i1 %32, label %36, label %33
33: ; preds = %29
%34 = load i32, i32* %3
%35 = add nsw i32 %34, 6
store i32 %35, i32* %3
br label %60
36: ; preds = %29
%37 = getelementptr inbounds [13 x i8], [13 x i8]* %4, i64 0, i64 0
%38 = call i32 @strcmp(i8* %37, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
%39 = icmp ne i32 %38, 0
br i1 %39, label %43, label %40
40: ; preds = %36
%41 = load i32, i32* %3
%42 = add nsw i32 %41, 8
store i32 %42, i32* %3
br label %59
43: ; preds = %36
%44 = getelementptr inbounds [13 x i8], [13 x i8]* %4, i64 0, i64 0
%45 = call i32 @strcmp(i8* %44, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%46 = icmp ne i32 %45, 0
br i1 %46, label %50, label %47
47: ; preds = %43
%48 = load i32, i32* %3
%49 = add nsw i32 %48, 12
store i32 %49, i32* %3
br label %58
50: ; preds = %43
%51 = getelementptr inbounds [13 x i8], [13 x i8]* %4, i64 0, i64 0
%52 = call i32 @strcmp(i8* %51, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0))
%53 = icmp ne i32 %52, 0
br i1 %53, label %57, label %54
54: ; preds = %50
%55 = load i32, i32* %3
%56 = add nsw i32 %55, 20
store i32 %56, i32* %3
br label %57
57: ; preds = %54, %50
br label %58
58: ; preds = %57, %47
br label %59
59: ; preds = %58, %40
br label %60
60: ; preds = %59, %33
br label %61
61: ; preds = %60, %26
br label %62
62: ; preds = %61
%63 = load i32, i32* %5
%64 = add nsw i32 %63, 1
store i32 %64, i32* %5
br label %7
65: ; preds = %7
%66 = load i32, i32* %3
%67 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %66)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [6 x i8] c"%12s\0A\00"
@.str.2 = [5 x i8] c"%12s\00"
@.str.3 = [12 x i8] c"Tetrahedron\00"
@.str.4 = [5 x i8] c"Cube\00"
@.str.5 = [11 x i8] c"Octahedron\00"
@.str.6 = [13 x i8] c"Dodecahedron\00"
@.str.7 = [12 x i8] c"Icosahedron\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [13 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %43, %0
%9 = phi i32 [ 0, %0 ], [ %44, %43 ]
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
11: ; preds = %0, %43
%12 = phi i32 [ %46, %43 ], [ %6, %0 ]
%13 = phi i32 [ %45, %43 ], [ 0, %0 ]
%14 = phi i32 [ %44, %43 ], [ 0, %0 ]
%15 = add nsw i32 %12, -1
%16 = icmp eq i32 %13, %15
%17 = select i1 %16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%18 = call i32 (i8*, ...) @scanf(i8* %17, i8* %4)
%19 = call i32 @bcmp(i8* dereferenceable(12) %4, i8* dereferenceable(12) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i64 12)
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %11
%22 = add nsw i32 %14, 4
br label %43
23: ; preds = %11
%24 = call i32 @bcmp(i8* dereferenceable(5) %4, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i64 5)
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = add nsw i32 %14, 6
br label %43
28: ; preds = %23
%29 = call i32 @bcmp(i8* dereferenceable(11) %4, i8* dereferenceable(11) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i64 11)
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = add nsw i32 %14, 8
br label %43
33: ; preds = %28
%34 = call i32 @bcmp(i8* dereferenceable(13) %4, i8* dereferenceable(13) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i64 13)
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %38
36: ; preds = %33
%37 = add nsw i32 %14, 12
br label %43
38: ; preds = %33
%39 = call i32 @bcmp(i8* dereferenceable(12) %4, i8* dereferenceable(12) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i64 12)
%40 = icmp eq i32 %39, 0
%41 = add nsw i32 %14, 20
%42 = select i1 %40, i32 %41, i32 %14
br label %43
43: ; preds = %38, %21, %31, %36, %26
%44 = phi i32 [ %37, %36 ], [ %32, %31 ], [ %27, %26 ], [ %22, %21 ], [ %42, %38 ]
%45 = add nuw nsw i32 %13, 1
%46 = load i32, i32* %1
%47 = icmp slt i32 %45, %46
br i1 %47, label %11, label %8
}