Anton's favourite geometric figures are regular polyhedrons. Note that there are five kinds of regular polyhedrons: 

  Tetrahedron. Tetrahedron has 4 triangular faces.  Cube. Cube has 6 square faces.  Octahedron. Octahedron has 8 triangular faces.  Dodecahedron. Dodecahedron has 12 pentagonal faces.  Icosahedron. Icosahedron has 20 triangular faces. 

All five kinds of polyhedrons are shown on the picture below:

 [Image] 

Anton has a collection of n polyhedrons. One day he decided to know, how many faces his polyhedrons have in total. Help Anton and find this number!


-----Input-----

The first line of the input contains a single integer n (1 ≤ n ≤ 200 000) — the number of polyhedrons in Anton's collection.

Each of the following n lines of the input contains a string s_{i} — the name of the i-th polyhedron in Anton's collection. The string can look like this:

  "Tetrahedron" (without quotes), if the i-th polyhedron in Anton's collection is a tetrahedron.  "Cube" (without quotes), if the i-th polyhedron in Anton's collection is a cube.  "Octahedron" (without quotes), if the i-th polyhedron in Anton's collection is an octahedron.  "Dodecahedron" (without quotes), if the i-th polyhedron in Anton's collection is a dodecahedron.  "Icosahedron" (without quotes), if the i-th polyhedron in Anton's collection is an icosahedron. 


-----Output-----

Output one number — the total number of faces in all the polyhedrons in Anton's collection.


-----Examples-----
Input
4
Icosahedron
Cube
Tetrahedron
Dodecahedron

Output
42

Input
3
Dodecahedron
Octahedron
Octahedron

Output
28



-----Note-----

In the first sample Anton has one icosahedron, one cube, one tetrahedron and one dodecahedron. Icosahedron has 20 faces, cube has 6 faces, tetrahedron has 4 faces and dodecahedron has 12 faces. In total, they have 20 + 6 + 4 + 12 = 42 faces.

Difficulty: EASY

Solutions:
n = int(input())
h = 0
for i in range(n):
	v = input()
	if v == 'Tetrahedron':
		h += 4
	elif v == 'Cube':
		h += 6
	elif v == 'Octahedron':
		h += 8
	elif v == 'Dodecahedron':
		h += 12
	else:
		h += 20
print(h)


n = int(input())
s = 0
tb = {'T': 4, 'I': 20, 'C': 6, 'O': 8, 'D': 12}
for i in range(n):
	x = input()
	s += tb[x[0]]
print(s)


d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
print(sum((d[input()] for _ in range(int(input())))))


n = int(input())
i = 0
out = 0
if 1 <= n <= 200000:
	while n > i:
		choise = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
		out = out + choise.get(input())
		i += 1
print(out)


n = int(input())
i = 0
sum = 0
if n >= 1 and n <= 200000:
	while i < n:
		a = str(input())
		if a == 'Icosahedron':
			sum += 20
		elif a == 'Dodecahedron':
			sum += 12
		elif a == 'Octahedron':
			sum += 8
		elif a == 'Cube':
			sum += 6
		elif a == 'Tetrahedron':
			sum += 4
		else:
			print('Вы допустили опечатку в написании...')
		i += 1
print(sum)


n = input()
l = []
for i in range(int(n)):
	s = input()
	l.append(s)
i1 = 0
for i in l:
	if i == 'Tetrahedron':
		i1 += 4
	if i == 'Cube':
		i1 += 6
	if i == 'Octahedron':
		i1 += 8
	if i == 'Dodecahedron':
		i1 += 12
	if i == 'Icosahedron':
		i1 += 20
print(i1)


ans = 0
for _ in range(int(input())):
	b = {'Cube': 6, 'Tetrahedron': 4, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	ans += b[input()]
print(ans)


shapes = [['Tetrahedron', 4], ['Cube', 6], ['Octahedron', 8], ['Dodecahedron', 12], ['Icosahedron', 20]]
n = int(input())
nums = []
for i in range(n):
	i = input()
	for a in shapes:
		if i in a:
			nums.append(a[1])
print(sum(nums))


t = 0
for i in range(int(input())):
	a = input()
	if a == 'Icosahedron':
		t += 20
	elif a == 'Cube':
		t += 6
	elif a == 'Tetrahedron':
		t += 4
	elif a == 'Dodecahedron':
		t += 12
	elif a == 'Octahedron':
		t += 8
print(t)


n = int(input())
ans = 0
for i in range(0, n):
	y = input()
	if y == 'Tetrahedron':
		ans += 4
	elif y == 'Cube':
		ans += 6
	elif y == 'Octahedron':
		ans += 8
	elif y == 'Dodecahedron':
		ans += 12
	else:
		ans += 20
print(ans)


import sys

def solution():
	count = int(sys.stdin.readline())
	angles = 0
	for i in range(0, count):
		figure = str(sys.stdin.readline())
		figure = figure.strip('\n')
		if figure == 'Tetrahedron':
			angles += 4
		elif figure == 'Cube':
			angles += 6
		elif figure == 'Octahedron':
			angles += 8
		elif figure == 'Icosahedron':
			angles += 20
		elif figure == 'Dodecahedron':
			angles += 12
	return print(angles)
solution()


n = int(input())
name = list()
count = 0
for i in range(n):
	name.append(input())
for s in name:
	if s == 'Tetrahedron':
		count += 4
	elif s == 'Cube':
		count += 6
	elif s == 'Octahedron':
		count += 8
	elif s == 'Dodecahedron':
		count += 12
	elif s == 'Icosahedron':
		count += 20
print(count)


n = int(input())
l1 = ['T', 'C', 'O', 'D', 'I']
l2 = [4, 6, 8, 12, 20]
sm = 0
for i in range(n):
	s = input()
	sm += l2[l1.index(s[0])]
print(sm)


faces = 0
for _ in range(int(input())):
	s = input()
	if s == 'Tetrahedron':
		faces += 4
	elif s == 'Cube':
		faces += 6
	elif s == 'Octahedron':
		faces += 8
	elif s == 'Dodecahedron':
		faces += 12
	elif s == 'Icosahedron':
		faces += 20
print(faces)


dict = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
s = 0
for _ in range(int(input())):
	s += dict[input()[0]]
print(s)


a = int(input())
l = []
s = 0
for i in range(a):
	b = input()
	l.append(b)
for i in l:
	if i == 'Cube':
		s += 6
	elif i == 'Tetrahedron':
		s += 4
	elif i == 'Octahedron':
		s += 8
	elif i == 'Dodecahedron':
		s += 12
	elif i == 'Icosahedron':
		s += 20
print(s)


Num = int(input())
list_1 = []
for _ in range(Num):
	slovo = input()
	if slovo == 'Tetrahedron':
		list_1.append(4)
	elif slovo == 'Cube':
		list_1.append(6)
	elif slovo == 'Octahedron':
		list_1.append(8)
	elif slovo == 'Dodecahedron':
		list_1.append(12)
	elif slovo == 'Icosahedron':
		list_1.append(20)
print(sum(list_1))


n = int(input())
cnt = 0
while n:
	n -= 1
	a = input()
	if a == 'Tetrahedron':
		cnt += 4
	if a == 'Cube':
		cnt += 6
	if a == 'Octahedron':
		cnt += 8
	if a == 'Dodecahedron':
		cnt += 12
	if a == 'Icosahedron':
		cnt += 20
print(cnt)


n = int(input())
summ = 0
for i in range(n):
	str = input()
	if str == 'Tetrahedron':
		summ += 4
	elif str == 'Cube':
		summ += 6
	elif str == 'Octahedron':
		summ += 8
	elif str == 'Dodecahedron':
		summ += 12
	elif str == 'Icosahedron':
		summ += 20
print(summ)


figures = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
s = sum((figures[input()] for _ in range(n)))
print(s)


n = int(input())
face = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
ans = 0
for _ in range(n):
	x = str(input())
	ans += face[x]
print(ans)


line = int(input())
total = 0
for i in range(line):
	shape = input()
	if shape == 'Icosahedron':
		total = total + 20
	elif shape == 'Cube':
		total = total + 6
	elif shape == 'Tetrahedron':
		total = total + 4
	elif shape == 'Dodecahedron':
		total = total + 12
	elif shape == 'Octahedron':
		total = total + 8
print(total)


regular_polyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
count = 0
for i in range(0, n):
	polyhedron = input()
	if polyhedron in regular_polyhedrons:
		count += regular_polyhedrons[polyhedron]
print(count)


table = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
tst_case = int(input())
cnt = 0
for i in range(tst_case):
	ipt = input()
	cnt += table[ipt]
print(cnt)


n = input()
n = int(n)
otvet = 0
while n > 0:
	s = input()
	if s == 'Tetrahedron':
		otvet = otvet + 4
	elif s == 'Cube':
		otvet = otvet + 6
	elif s == 'Octahedron':
		otvet = otvet + 8
	elif s == 'Dodecahedron':
		otvet = otvet + 12
	elif s == 'Icosahedron':
		otvet = otvet + 20
	n = n - 1
print(otvet)


x = int(input())
a = list()
c = 0
for i in range(x):
	s = input()
	if s == 'Tetrahedron':
		c += 4
	elif s == 'Cube':
		c += 6
	elif s == 'Octahedron':
		c += 8
	elif s == 'Dodecahedron':
		c += 12
	elif s == 'Icosahedron':
		c += 20
print(c)


n = int(input())
count = 0
for i in range(n):
	shape = input()
	if shape == 'Tetrahedron':
		count += 4
	elif shape == 'Cube':
		count += 6
	elif shape == 'Octahedron':
		count += 8
	elif shape == 'Dodecahedron':
		count += 12
	elif shape == 'Icosahedron':
		count += 20
print(count)


q = int(input())
ans = 0
for _ in range(q):
	n = input()
	if n == 'Icosahedron':
		ans += 20
	if n == 'Tetrahedron':
		ans += 4
	if n == 'Cube':
		ans += 6
	if n == 'Octahedron':
		ans += 8
	if n == 'Dodecahedron':
		ans += 12
print(ans)


get = int(input())
sum = 0
if 1 <= get <= 200000:
	for x in range(get):
		obj = input()
		if obj == 'Tetrahedron':
			sum += 4
		elif obj == 'Cube':
			sum += 6
		elif obj == 'Octahedron':
			sum += 8
		elif obj == 'Dodecahedron':
			sum += 12
		elif obj == 'Icosahedron':
			sum += 20
print(sum)


n = int(input())
s = []
a = int(0)
for i in range(1, n + 1):
	s.insert(i, input())
for i in s:
	if i == 'Tetrahedron':
		a = a + 4
	elif i == 'Cube':
		a = a + 6
	elif i == 'Octahedron':
		a = a + 8
	elif i == 'Dodecahedron':
		a = a + 12
	elif i == 'Icosahedron':
		a = a + 20
print(int(a))


a = int(input())
b = 0
while a > 0:
	c = input()
	if c == 'Tetrahedron':
		b = b + 4
	elif c == 'Cube':
		b = b + 6
	elif c == 'Octahedron':
		b = b + 8
	elif c == 'Dodecahedron':
		b = b + 12
	elif c == 'Icosahedron':
		b = b + 20
	a = a - 1
print(b)


n = int(input())
shapes = []
for i in range(0, n):
	shapes.append(input())
s = 0
c = 0
if 'Tetrahedron' in shapes:
	c = shapes.count('Tetrahedron')
	s = s + c * 4
if 'Cube' in shapes:
	c = shapes.count('Cube')
	s += c * 6
if 'Octahedron' in shapes:
	c = shapes.count('Octahedron')
	s += c * 8
if 'Dodecahedron' in shapes:
	c = shapes.count('Dodecahedron')
	s += c * 12
if 'Icosahedron' in shapes:
	c = shapes.count('Icosahedron')
	s += c * 20
print(s)


a = int(input())
lst = []
face = 0
for i in range(a):
	lst.append(input())
	if lst[i] == 'Tetrahedron':
		face = face + 4
	elif lst[i] == 'Cube':
		face = face + 6
	elif lst[i] == 'Octahedron':
		face = face + 8
	elif lst[i] == 'Dodecahedron':
		face = face + 12
	elif lst[i] == 'Icosahedron':
		face = face + 20
print(face)


n = int(input())
sum = 0
for i in range(n):
	s = input()
	if s[0] == 'T':
		sum += 4
	elif s[0] == 'C':
		sum += 6
	elif s[0] == 'O':
		sum += 8
	elif s[0] == 'D':
		sum += 12
	elif s[0] == 'I':
		sum += 20
print(sum)


t = int(input())
sum = 0
while t > 0:
	a = input()
	if 'Tetrahedron' in a.capitalize():
		sum += 4
	elif 'Cube' in a.capitalize():
		sum += 6
	elif 'Octahedron' in a.capitalize():
		sum += 8
	elif 'Dodecahedron' in a.capitalize():
		sum += 12
	elif 'Icosahedron' in a.capitalize():
		sum += 20
	t -= 1
print(sum)


def solve():
	n = int(input())
	figs = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	s = 0
	for i in range(n):
		f = input()
		s += figs[f]
	print(s)
solve()


n = int(input())
l = []
d = {'Icosahedron': 20, 'Cube': 6, 'Tetrahedron': 4, 'Dodecahedron': 12, 'Octahedron': 8}
sum = 0
for i in range(n):
	put = input()
	sum += d[put]
print(sum)


cnt = 0
for _ in range(int(input())):
	strings = input()
	if strings == 'Tetrahedron':
		cnt += 4
	elif strings == 'Cube':
		cnt += 6
	elif strings == 'Octahedron':
		cnt += 8
	elif strings == 'Dodecahedron':
		cnt += 12
	elif strings == 'Icosahedron':
		cnt += 20
print(cnt)


n = int(input())
s = 0
for i in range(n):
	a = input()
	if a == 'Tetrahedron':
		s += 4
	elif a == 'Cube':
		s += 6
	elif a == 'Octahedron':
		s += 8
	elif a == 'Dodecahedron':
		s += 12
	else:
		s += 20
print(s)


s = 0
d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
for i in range(n):
	s += d[input()]
print(s)


t = int(input())
d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
c = 0
for w in range(t):
	c += d[input()]
print(c)


result = 0
n = int(input())
for i in range(n):
	m = input()
	if m == 'Tetrahedron':
		result += 4
	elif m == 'Cube':
		result += 6
	elif m == 'Octahedron':
		result += 8
	elif m == 'Dodecahedron':
		result += 12
	elif m == 'Icosahedron':
		result += 20
print(result)


n = int(input())
dic = {'Icosahedron': 20, 'Cube': 6, 'Octahedron': 8, 'Tetrahedron': 4, 'Dodecahedron': 12}
res = 0
for i in range(n):
	x = str(input())
	res += dic[x]
print(res)


n = int(input())
total_no_of_faces = 0
for i in range(0, n):
	ph = str(input())
	if ph == 'Tetrahedron':
		total_no_of_faces += 4
	elif ph == 'Cube':
		total_no_of_faces += 6
	elif ph == 'Octahedron':
		total_no_of_faces += 8
	elif ph == 'Dodecahedron':
		total_no_of_faces += 12
	else:
		total_no_of_faces += 20
print(total_no_of_faces)


n = int(input())
t = 0
c = 0
o = 0
d = 0
i = 0
for j in range(n):
	s = input()
	if s == 'Tetrahedron':
		t = t + 1
	elif s == 'Cube':
		c = c + 1
	elif s == 'Octahedron':
		o = o + 1
	elif s == 'Dodecahedron':
		d = d + 1
	else:
		i = i + 1
print(t * 4 + c * 6 + o * 8 + d * 12 + i * 20)


def antonAndPolyhedron():
	n = int(input())
	string = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	sum = 0
	for i in range(n):
		value = input()
		sum += string[value]
	print(sum)
antonAndPolyhedron()


a = int(input())
count = 0
while a > 0:
	s = input()
	if s == 'Tetrahedron':
		count += 4
	elif s == 'Cube':
		count += 6
	elif s == 'Octahedron':
		count += 8
	elif s == 'Dodecahedron':
		count += 12
	else:
		count += 20
	a -= 1
print(count)


dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
Sum = 0
for i in range(n):
	Sum += dict[input()]
print(Sum)


n = int(input())
polyhedron = []
for i in range(n):
	polyhedron.append(input())
count = 0
for poly in polyhedron:
	if poly == 'Tetrahedron':
		count += 4
	elif poly == 'Cube':
		count += 6
	elif poly == 'Octahedron':
		count += 8
	elif poly == 'Dodecahedron':
		count += 12
	else:
		count += 20
print(count)


n = int(input())
sum = 0
for i in range(n):
	q = input()
	if q == 'Tetrahedron':
		sum += 4
	if q == 'Cube':
		sum += 6
	if q == 'Octahedron':
		sum += 8
	if q == 'Dodecahedron':
		sum += 12
	if q == 'Icosahedron':
		sum += 20
print(sum)


n = int(input())
f = 0
for i in range(n):
	s = input()
	if s == 'Tetrahedron':
		f += 4
	elif s == 'Cube':
		f += 6
	elif s == 'Octahedron':
		f += 8
	elif s == 'Dodecahedron':
		f += 12
	elif s == 'Icosahedron':
		f += 20
print(f)


n = int(input())
Tetrahedron = 4
Cube = 6
Octahedron = 8
Dodecahedron = 12
Icosahedron = 20
sum = 0
for i in range(n):
	num = input()
	if num[0] == 'T':
		sum = sum + 4
	elif num[0] == 'C':
		sum = sum + 6
	elif num[0] == 'O':
		sum = sum + 8
	elif num[0] == 'D':
		sum = sum + 12
	elif num[0] == 'I':
		sum = sum + 20
	else:
		sum = sum + 0
print(sum)


n = int(input())
v = []
for i in range(n):
	v.append(input())
k = 0
for i in v:
	if i == 'Tetrahedron':
		k += 4
	elif i == 'Cube':
		k += 6
	elif i == 'Octahedron':
		k += 8
	elif i == 'Dodecahedron':
		k += 12
	elif i == 'Icosahedron':
		k += 20
print(k)


dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
c = 0
for i in range(int(input())):
	x = input()
	c += dict[x]
print(c)


from functools import reduce
polyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}

def readInput():
	return [input() for _ in range(int(input()))]
valueResult = reduce(lambda a, b: a + b, list(map(lambda x: polyhedrons[x], readInput())))
print(valueResult)


import sys
ans = 0
val_of = dict(Tetrahedron=4, Cube=6, Octahedron=8, Dodecahedron=12, Icosahedron=20)
idx = int(input())
for i in range(idx):
	poly = input()
	ans += val_of[poly]
print(ans)


n = int(input())
total = 0
for i in range(n):
	fig = input()
	if fig == 'Tetrahedron':
		total += 4
	elif fig == 'Cube':
		total += 6
	elif fig == 'Octahedron':
		total += 8
	elif fig == 'Dodecahedron':
		total += 12
	elif fig == 'Icosahedron':
		total += 20
print(total)


while 1:
	try:
		n = int(input())
	except:
		break
	face = 0
	p = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	for i in range(n):
		x = input()
		face += p[x]
	print(face)


def judge(ch):
	return {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}.get(ch)
n = int(input())
sum = 0
for i in range(0, n):
	str = input()
	sum += judge(str[0])
print(sum)


N = int(input())
dp_array = [0] * 5
for i in range(N):
	name = input()
	if name == 'Tetrahedron':
		dp_array[0] += 1
	elif name == 'Cube':
		dp_array[1] += 1
	elif name == 'Octahedron':
		dp_array[2] += 1
	elif name == 'Dodecahedron':
		dp_array[3] += 1
	else:
		dp_array[4] += 1
ans = dp_array[0] * 4 + dp_array[1] * 6 + dp_array[2] * 8 + dp_array[3] * 12 + dp_array[4] * 20
print(ans)


print(sum([{'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}[input()[0]] for _ in '_' * int(input())]))


mymap = {'Icosahedron': 20, 'Dodecahedron': 12, 'Octahedron': 8, 'Cube': 6, 'Tetrahedron': 4}
n = int(input())
data = []
for i in range(n):
	data.append(input())
s = 0
for i in range(len(data)):
	s += mymap.get(data[i])
print(s)


n = int(input())
t = 0
for _ in range(n):
	s = str(input())
	if s == 'Tetrahedron':
		t = t + 4
	elif s == 'Cube':
		t = t + 6
	elif s == 'Octahedron':
		t = t + 8
	elif s == 'Dodecahedron':
		t = t + 12
	elif s == 'Icosahedron':
		t = t + 20
print(t)


res = 0
for i in range(int(input())):
	string = input()
	if string == 'Tetrahedron':
		res += 4
	elif string == 'Cube':
		res += 6
	elif string == 'Octahedron':
		res += 8
	elif string == 'Dodecahedron':
		res += 12
	else:
		res += 20
print(res)


n = input()
n = int(n)
nums = ''
for i in range(n):
	nums += input() + '\n'
nums = [x for x in nums.strip().split()]
count = 0
for i in nums:
	if i == 'Tetrahedron':
		count += 4
	if i == 'Cube':
		count += 6
	if i == 'Octahedron':
		count += 8
	if i == 'Dodecahedron':
		count += 12
	if i == 'Icosahedron':
		count += 20
print(count)


import sys
cnt = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
c = 0
for _ in range(n):
	s = input()
	c += cnt[s]
print(c)


vals = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
ans = 0
for e in range(0, n):
	ans = ans + vals[input()]
print(ans)


(n, count) = (int(input()), 0)
for _ in range(n):
	s = input()
	if s[0] == 'T':
		count += 4
	elif s[0] == 'C':
		count += 6
	elif s[0] == 'O':
		count += 8
	elif s[0] == 'D':
		count += 12
	elif s[0] == 'I':
		count += 20
print(count)


a = int(input())
count = 0
for i in range(a):
	b = input()
	if b == 'Tetrahedron':
		count = count + 4
	elif b == 'Cube':
		count = count + 6
	elif b == 'Octahedron':
		count = count + 8
	elif b == 'Dodecahedron':
		count = count + 12
	else:
		count = count + 20
print(count)


t = int(input())
r = 0
while t > 0:
	s = input()
	if s == 'Tetrahedron':
		r += 4
	elif s == 'Cube':
		r += 6
	elif s == 'Octahedron':
		r += 8
	elif s == 'Dodecahedron':
		r += 12
	elif s == 'Icosahedron':
		r += 20
	t -= 1
print(r)


a = int(input())
s = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
ans = 0
for i in range(a):
	b = input()
	ans += s[b]
print(ans)


from sys import stdin
N = int(stdin.readline())
total = 0
faces = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for case in range(N):
	total += faces[stdin.readline().strip()]
print(total)


import random
import time
k = 0
n = int(input())
for i in range(n):
	a = input()
	if a == 'Tetrahedron':
		k += 4
	if a == 'Cube':
		k += 6
	if a == 'Octahedron':
		k += 8
	if a == 'Dodecahedron':
		k += 12
	if a == 'Icosahedron':
		k += 20
print(k)


n = int(input())
dic = {'C': 6, 'T': 4, 'O': 8, 'D': 12, 'I': 20}
ans = 0
for _ in range(n):
	ans += dic[input()[0]]
print(ans)


value = input()
numlist = list()
for number in range(int(value)):
	name = input()
	if name == 'Tetrahedron':
		faces = 4
	elif name == 'Cube':
		faces = 6
	elif name == 'Octahedron':
		faces = 8
	elif name == 'Dodecahedron':
		faces = 12
	else:
		faces = 20
	numlist.append(faces)
print(sum(numlist))


n = int(input())
l = []
for i in range(n):
	s = input()
	if s == 'Tetrahedron':
		l.append(4)
	elif s == 'Cube':
		l.append(6)
	elif s == 'Octahedron':
		l.append(8)
	elif s == 'Dodecahedron':
		l.append(12)
	else:
		l.append(20)
print(sum(l))


n = int(input())
answer = 0
for i in range(n):
	temp = input()
	if temp == 'Tetrahedron':
		answer += 4
	elif temp == 'Cube':
		answer += 6
	elif temp == 'Octahedron':
		answer += 8
	elif temp == 'Dodecahedron':
		answer += 12
	elif temp == 'Icosahedron':
		answer += 20
print(answer)


n = int(input())
a = []
for i in range(0, n):
	ele = input()
	a.append(ele)
c = 0
for i in range(0, len(a)):
	if a[i] == 'Tetrahedron':
		c += 4
	elif a[i] == 'Cube':
		c += 6
	elif a[i] == 'Octahedron':
		c += 8
	elif a[i] == 'Dodecahedron':
		c += 12
	elif a[i] == 'Icosahedron':
		c += 20
print(c)


shapes = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
faces = 0
for i in range(n):
	faces += shapes[input()]
print(faces)


n = int(input())
value = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
ans = 0
for i in range(0, n):
	s = input()
	ans += value.get(s)
print(ans)


num = [4, 6, 8, 12, 20]
y = ['T', 'C', 'O', 'D', 'I']
s = 0
for i in range(int(input())):
	x = input()
	s += num[y.index(x[0])]
print(s)


n = int(input())
faces = 0
for i in range(n):
	s = input().split()
	str1 = s[0]
	if str1 == 'Icosahedron':
		faces += 20
	elif str1 == 'Cube':
		faces += 6
	elif str1 == 'Octahedron':
		faces += 8
	elif str1 == 'Tetrahedron':
		faces += 4
	elif str1 == 'Dodecahedron':
		faces += 12
print(faces)


n = int(input())
names = [input() for na in range(n)]
polyhedrons = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
faces = [4, 6, 8, 12, 20]
p = dict(zip(polyhedrons, faces))
plist = list(map(p.get, names))
print(sum(plist))


def main():
	polyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	n = int(input())
	tfaces = 0
	while n > 0:
		n -= 1
		tfaces += polyhedrons[input()]
	print(tfaces)
main()


n = int(input())
answer = 0
for i in range(n):
	polyhedron = input()
	if polyhedron == 'Tetrahedron':
		answer += 4
	elif polyhedron == 'Cube':
		answer += 6
	elif polyhedron == 'Octahedron':
		answer += 8
	elif polyhedron == 'Dodecahedron':
		answer += 12
	else:
		answer += 20
print(int(answer))


n = int(input())
D = {'Icosahedron': 20, 'Cube': 6, 'Tetrahedron': 4, 'Dodecahedron': 12, 'Octahedron': 8}
s = 0
while n != 0:
	n -= 1
	s += D[input()]
print(s)


n = int(input())
cnt = 0
a = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
for i in range(n):
	s = input()
	cnt += a[s[0]]
print(cnt)


n = int(input())
n_arr = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
v_arr = [4, 6, 8, 12, 20]
count = 0
while n:
	a = str(input())
	index = n_arr.index(a)
	count += v_arr[index]
	n -= 1
print(count)


n = int(input())
shapes = []
for i in range(n):
	temp = input()
	shapes.append(temp)
print(shapes.count('Tetrahedron') * 4 + shapes.count('Cube') * 6 + shapes.count('Octahedron') * 8 + shapes.count('Dodecahedron') * 12 + shapes.count('Icosahedron') * 20)


dic = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
faces = 0
for i in range(int(input())):
	x = input()
	faces += dic[x]
print(faces)


a = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
res = 0
for i in range(int(input())):
	res += a[input()[0]]
print(res)


my_dict = {}
shape = []
my_dict['Tetrahedron'] = 4
my_dict['Cube'] = 6
my_dict['Octahedron'] = 8
my_dict['Dodecahedron'] = 12
my_dict['Icosahedron'] = 20
sum = 0
n = int(input())
for i in range(n):
	shape.append(input())
for j in range(n):
	sum = sum + my_dict[shape[j]]
print(sum)


N = input()
total = 0
for i in range(0, int(N)):
	word = input()
	if word == 'Tetrahedron':
		total += 4
	elif word == 'Cube':
		total += 6
	elif word == 'Octahedron':
		total += 8
	elif word == 'Dodecahedron':
		total += 12
	elif word == 'Icosahedron':
		total += 20
print(total)


n = int(input())
value = 0
for i in range(n):
	s = input()
	if s[0] == 'T':
		value += 4
	elif s[0] == 'C':
		value += 6
	elif s[0] == 'O':
		value += 8
	elif s[0] == 'D':
		value += 12
	else:
		value += 20
print(value)


k = int(input())
ans = 0
i = 0
while i < k:
	ins = input()
	if ins[0] == 'T':
		ans += 4
	elif ins[0] == 'C':
		ans += 6
	elif ins[0] == 'O':
		ans += 8
	elif ins[0] == 'D':
		ans += 12
	elif ins[0] == 'I':
		ans += 20
	i += 1
print(ans)


mp = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
t = int(input())
sm = 0
for _ in range(t):
	sm += mp[input()]
print(sm)


collect_num = int(input())
turnout = 0
while collect_num > 0:
	m = str(input())
	if m == 'Tetrahedron':
		turnout = turnout + 4
	elif m == 'Cube':
		turnout = turnout + 6
	elif m == 'Octahedron':
		turnout = turnout + 8
	elif m == 'Dodecahedron':
		turnout = turnout + 12
	elif m == 'Icosahedron':
		turnout = turnout + 20
	collect_num = collect_num - 1
print(turnout)


poly = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
a = []
for _ in range(0, n):
	shape = input().title()
	a.append(shape)
answer = 0
for i in range(len(a)):
	answer += poly[a[i]]
print(answer)


def main():
	poly_hedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	n = int(input())
	ans = 0
	for i in range(n):
		ph = str(input())
		ans += poly_hedrons[ph]
	print(ans)
main()


FIGURES = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
count = 0
for i in range(int(input())):
	count += FIGURES[input()]
print(count)


n = int(input())
c = 0
for i in range(n):
	x = input()
	if x == 'Tetrahedron':
		c = c + 4
	elif x == 'Cube':
		c = c + 6
	elif x == 'Octahedron':
		c = c + 8
	elif x == 'Dodecahedron':
		c = c + 12
	elif x == 'Icosahedron':
		c = c + 20
print(c)


D = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
s = 0
for _ in range(int(input())):
	s += D[input()]
print(s)


from sys import stdin

def ii():
	return int(stdin.readline())

def mi():
	return map(int, stdin.readline().split())

def li():
	return list(mi())

def si():
	return stdin.readline()
a = ['T', 'C', 'O', 'D', 'I']
b = [4, 6, 8, 12, 20]
s = 0
for _ in range(ii()):
	x = si()
	s += b[a.index(x[0])]
print(s)


arr = []
for i in range(int(input())):
	x = input().lower()
	arr.append(x)
d = {'tetrahedron': 4, 'cube': 6, 'octahedron': 8, 'dodecahedron': 12, 'icosahedron': 20}
save = []
sum1 = 0
for i in arr:
	sum1 = sum1 + d[i]
print(sum1)


a = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
x = 0
for i in range(n):
	b = input()
	x = x + a.get(b)
print(x)


def totalHedrons(n):
	lookup = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	total = 0
	for i in range(n):
		hedron = input()
		total += lookup[hedron]
	return total
n = int(input())
print(totalHedrons(n))


repetition = int(input())
sum_sides = 0
for times in range(repetition):
	polyhedron = input()
	if polyhedron == 'Tetrahedron':
		sum_sides += 4
	elif polyhedron == 'Cube':
		sum_sides += 6
	elif polyhedron == 'Octahedron':
		sum_sides += 8
	elif polyhedron == 'Dodecahedron':
		sum_sides += 12
	elif polyhedron == 'Icosahedron':
		sum_sides += 20
print(sum_sides)


n = int(input())
d = dict()
d['T'] = 4
d['C'] = 6
d['O'] = 8
d['D'] = 12
d['I'] = 20
su = 0
for i in range(n):
	s = input()
	su += d[s[0]]
print(su)


n = int(input())
t = 0
for _ in range(n):
	k = input()
	if k[0] == 'T' and k[1] == 'e':
		t += 4
	elif k[0] == 'C':
		t += 6
	elif k[0] == 'O':
		t += 8
	elif k[0] == 'I':
		t += 20
	else:
		t += 12
print(t)


shape = []
for _ in range(int(input())):
	shape.append(input())
faces = 0
for i in shape:
	if i == 'Tetrahedron':
		faces += 4
	elif i == 'Cube':
		faces += 6
	elif i == 'Octahedron':
		faces += 8
	elif i == 'Dodecahedron':
		faces += 12
	else:
		faces += 20
print(faces)


d = int(input())
list1 = []
polyhedron = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
c = 0
for i in range(0, d):
	list1.append(input())
for i in list1:
	c += polyhedron[i]
print(c)


n = int(input())
lst = list()
ans = 0
for i in range(n):
	lst.append(input())
for j in lst:
	if j == 'Tetrahedron':
		ans += 4
	if j == 'Cube':
		ans += 6
	if j == 'Octahedron':
		ans += 8
	if j == 'Dodecahedron':
		ans += 12
	if j == 'Icosahedron':
		ans += 20
print(ans)


d = dict()
d['Icosahedron'] = 20
d['Cube'] = 6
d['Tetrahedron'] = 4
d['Dodecahedron'] = 12
d['Octahedron'] = 8
n = int(input())
sum = 0
for i in range(n):
	c = input()
	sum += d[c]
print(sum)


n = int(input())
count = 0
for i in range(0, n, 1):
	string = input()
	if string == 'Cube':
		count += 6
	if string == 'Tetrahedron':
		count += 4
	if string == 'Octahedron':
		count += 8
	if string == 'Dodecahedron':
		count += 12
	if string == 'Icosahedron':
		count += 20
print(count)


t = int(input())
i = 0
ans = 0
while i < t:
	val = str(input())
	if val[0] == 'I':
		ans += 20
	elif val[0] == 'C':
		ans += 6
	elif val[0] == 'O':
		ans += 8
	elif val[0] == 'D':
		ans += 12
	elif val[0] == 'T':
		ans += 4
	i += 1
print(ans)


d = {'Cube': 6, 'Icosahedron': 20, 'Dodecahedron': 12, 'Tetrahedron': 4, 'Octahedron': 8}
nface = 0
for i in range(int(input())):
	key = input()
	nface += d[key]
print(nface)


n = int(input())
list = []
for i in range(n):
	item = str(input())
	list.append(item)
res = 0
for i in range(n):
	if list[i] == 'Icosahedron':
		res += 20
	elif list[i] == 'Cube':
		res += 6
	elif list[i] == 'Tetrahedron':
		res += 4
	elif list[i] == 'Dodecahedron':
		res += 12
	elif list[i] == 'Octahedron':
		res += 8
print(res)


x = int(input())
s = 0
for i in range(x):
	p = input()
	if p[0] == 'T':
		s += 4
	if p[0] == 'C':
		s += 6
	if p[0] == 'O':
		s += 8
	if p[0] == 'D':
		s += 12
	if p[0] == 'I':
		s += 20
print(s)


n = int(input())
sum = 0
for i in range(n):
	a = input()
	if a[0] == 'I':
		sum += 20
	elif a[0] == 'D':
		sum += 12
	elif a[0] == 'O':
		sum += 8
	elif a[0] == 'C':
		sum += 6
	else:
		sum += 4
print(sum)


n = int(input())
a = []
while n:
	s = input()
	if s == 'Tetrahedron':
		a.append(4)
	elif s == 'Cube':
		a.append(6)
	elif s == 'Octahedron':
		a.append(8)
	elif s == 'Dodecahedron':
		a.append(12)
	else:
		a.append(20)
	n -= 1
print(sum(a))


def solve(polyhedrons):
	sides = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	ans = 0
	for polyhedron in polyhedrons:
		ans += sides[polyhedron]
	return ans
n = int(input())
polyhedrons = []
for i in range(n):
	polyhedrons.append(input())
print(solve(polyhedrons))


face = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
res = 0
for _ in range(n):
	s = input()
	res += face[s]
print(res)


n = int(input())
string = []
i = 0
total = 0
dictionary = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
while i < n:
	string.append(input())
	total += dictionary[string[i]]
	i += 1
print(total)


n = int(input().split()[0])
a1 = 0
a2 = 0
a3 = 0
a4 = 0
a5 = 0
for i in range(n):
	p = input()
	if p == 'Icosahedron':
		a5 = a5 + 1
	elif p == 'Cube':
		a2 += 1
	elif p == 'Dodecahedron':
		a4 += 1
	elif p == 'Octahedron':
		a3 += 1
	else:
		a1 += 1
print(4 * a1 + 6 * a2 + 8 * a3 + 12 * a4 + 20 * a5)


n = int(input())
polyhedron = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
ans = 0
for i in range(n):
	ans += polyhedron[input()]
print(ans)


sum1 = 0
for _ in range(int(input())):
	n = input()
	if n == 'Icosahedron':
		sum1 += 20
	elif n == 'Dodecahedron':
		sum1 += 12
	elif n == 'Octahedron':
		sum1 += 8
	elif n == 'Cube':
		sum1 += 6
	elif n == 'Tetrahedron':
		sum1 += 4
print(sum1)


def find_faces(n, arr):
	total_faces = 0
	for polyhedron in polyhedrons:
		if polyhedron == 'Tetrahedron':
			total_faces += 4
		elif polyhedron == 'Cube':
			total_faces += 6
		elif polyhedron == 'Octahedron':
			total_faces += 8
		elif polyhedron == 'Dodecahedron':
			total_faces += 12
		elif polyhedron == 'Icosahedron':
			total_faces += 20
		else:
			print('Unknown Value:', polyhedron)
	return total_faces
n = int(input())
polyhedrons = []
while n + 1 > 1:
	polyhedrons.append(str(input()))
	n -= 1
print(find_faces(n, polyhedrons))


import sys
n = int(sys.stdin.readline().split()[0])
s = []
faces = 0
for line in sys.stdin:
	for word in line.split():
		s.append(word)
for i in s:
	if i == 'Tetrahedron':
		faces += 4
	elif i == 'Cube':
		faces += 6
	elif i == 'Octahedron':
		faces += 8
	elif i == 'Dodecahedron':
		faces += 12
	elif i == 'Icosahedron':
		faces += 20
print(faces)


f = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
a = [4, 6, 8, 12, 20]
s = 0
for _ in range(int(input())):
	s += a[f.index(input())]
print(s)


n = int(input())
c = 0
for _ in range(n):
	s = input()
	if s == 'Icosahedron':
		c = c + 20
	elif s == 'Cube':
		c = c + 6
	elif s == 'Tetrahedron':
		c = c + 4
	elif s == 'Dodecahedron':
		c = c + 12
	else:
		c = c + 8
print(c)


n = int(input())
num = 0
for i in range(n):
	w = input()
	if w == 'Tetrahedron':
		num += 4
	elif w == 'Cube':
		num += 6
	elif w == 'Octahedron':
		num += 8
	elif w == 'Dodecahedron':
		num += 12
	else:
		num += 20
print(num)


n = int(input())
ans = 0
dct = dict(T=4, C=6, O=8, D=12, I=20)
for _ in range(n):
	x = input()[0]
	ans += dct[x]
print(ans)


n = int(input())
figuresRaw = []
for i in range(n):
	figuresRaw.append(input())
figures = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
sumi = 0
for i in range(n):
	current = figuresRaw[i]
	sumi += figures[current]
print(sumi)


n = int(input())
a = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
sum = 0
for i in range(n):
	x = input()
	sum += a[x[0]]
print(sum)


dic1 = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
add = 0
t = int(input())
for i in range(t):
	x = input()
	if x in dic1:
		add = add + dic1[x]
print(add)


polyhedrons = {'tetrahedron': 4, 'cube': 6, 'octahedron': 8, 'dodecahedron': 12, 'icosahedron': 20}
n = int(input())
res = 0
for line in range(0, n):
	x = input().lower()
	res += polyhedrons[x]
print(res)


n = int(input())
count = 0
for _ in range(n):
	name = str(input())
	if name == 'Icosahedron':
		count += 20
	elif name == 'Cube':
		count += 6
	elif name == 'Tetrahedron':
		count += 4
	elif name == 'Dodecahedron':
		count += 12
	elif name == 'Octahedron':
		count += 8
print(count)


import sys
n = int(input())
count = 0
for i in range(n):
	polyhedron = input()
	if polyhedron == 'Tetrahedron':
		count += 4
	elif polyhedron == 'Cube':
		count += 6
	elif polyhedron == 'Octahedron':
		count += 8
	elif polyhedron == 'Dodecahedron':
		count += 12
	elif polyhedron == 'Icosahedron':
		count += 20
print(count)


i = int(input())
dis = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
sum1 = 0
for i in range(i):
	sum1 = sum1 + dis[input()]
print(sum1)


n = int(input())
sum = 0
for i in range(n):
	x = input()
	if x == 'Tetrahedron':
		sum += 4
	elif x == 'Cube':
		sum += 6
	elif x == 'Octahedron':
		sum += 8
	elif x == 'Dodecahedron':
		sum += 12
	else:
		sum += 20
print(sum)


n = int(input())
s1 = 0
dictionary = {'T': 4, 'C': 6, 'D': 12, 'O': 8, 'I': 20}
for i in range(n):
	s = input()
	s1 = s1 + dictionary[s[0]]
print(s1)


def countFaces():
	count = 0
	numOfPolyhedrons = int(input())
	for n in range(numOfPolyhedrons):
		polyhedron = input()
		if polyhedron[0] == 'T':
			count = count + 4
		elif polyhedron[0] == 'C':
			count = count + 6
		elif polyhedron[0] == 'O':
			count = count + 8
		elif polyhedron[0] == 'D':
			count = count + 12
		else:
			count = count + 20
	return count
totalFaces = countFaces()
print(totalFaces)


n = int(input())
d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
sum = 0
for i in range(n):
	a = input()
	for i in d:
		if i == a:
			sum += d[i]
print(sum)
del d


t = int(input())
c = 0
while t > 0:
	str = input()
	if str[0] == 'T':
		c = c + 4
	elif str[0] == 'C':
		c = c + 6
	elif str[0] == 'O':
		c = c + 8
	elif str[0] == 'D':
		c = c + 12
	elif str[0] == 'I':
		c = c + 20
	t = t - 1
print(c)


n = int(input())
poligonos = {'Octahedron': 8, 'Icosahedron': 20, 'Cube': 6, 'Tetrahedron': 4, 'Dodecahedron': 12}
sum = 0
for i in range(n):
	nome = input()
	sum = sum + poligonos[nome]
print(sum)


polyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
collection = []
for i in range(n):
	name = input()
	collection.append(name)
faces = 0
for j in collection:
	faces += polyhedrons[j]
print(faces)


n = int(input())
s1 = 0
d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(n):
	s = input()
	for (k, v) in d.items():
		if s == k:
			s1 += v
print(s1)


amt = int(input())
xx = ''
amtsur = 0
for i in range(amt):
	xx = input()
	amtsur = amtsur + xx.count('Tetrahedron') * 4 + xx.count('Cube') * 6 + xx.count('Octahedron') * 8 + xx.count('Dodecahedron') * 12 + xx.count('Icosahedron') * 20
print(amtsur)


num = int(input())
polygons = []
total = 0
while num != 0:
	shape = input()
	if shape == 'Icosahedron':
		total += 20
	elif shape == 'Dodecahedron':
		total += 12
	elif shape == 'Octahedron':
		total += 8
	elif shape == 'Cube':
		total += 6
	elif shape == 'Tetrahedron':
		total += 4
	num -= 1
print(total)


n = int(input())
Polyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
k = 0
for _ in range(n):
	s = input()
	k += Polyhedrons[s]
print(k)


n = int(input())
ans = 0
for i in range(n):
	a = str(input()).split()
	if a[0] == 'Tetrahedron':
		ans += 4
	elif a[0] == 'Cube':
		ans += 6
	elif a[0] == 'Octahedron':
		ans += 8
	elif a[0] == 'Dodecahedron':
		ans += 12
	elif a[0] == 'Icosahedron':
		ans = ans + 20
	else:
		pass
print(ans)


def operations(operator):
	return {'Tetrahedron': lambda : 4, 'Cube': lambda : 6, 'Octahedron': lambda : 8, 'Dodecahedron': lambda : 12, 'Icosahedron': lambda : 20}.get(operator, lambda : 'Not a valid operation')()
count = int(input())
ans = 0
for i in range(count):
	name = input()
	ans = ans + operations(name)
print(ans)


n = int(input(''))
(Tetra, Cube, Octa, Dode, Ico) = (0, 0, 0, 0, 0)
for i in range(n):
	str = input('')
	if str == 'Tetrahedron':
		Tetra += 1
	elif str == 'Cube':
		Cube += 1
	elif str == 'Octahedron':
		Octa += 1
	elif str == 'Dodecahedron':
		Dode += 1
	else:
		Ico += 1
edges = Tetra * 4 + Cube * 6 + Octa * 8 + Dode * 12 + Ico * 20
print(edges)


x = int(input())
z = []
s = 0
for i in range(x):
	y = input()
	z.append(y)
d = {'Icosahedron': 20, 'Cube': 6, 'Tetrahedron': 4, 'Dodecahedron': 12, 'Octahedron': 8}
for i in z:
	s += d[i]
print(s)


numPolyhedrons = int(input())
numFaces = 0
for num in range(0, numPolyhedrons):
	shape = input()
	if shape == 'Tetrahedron':
		numFaces += 4
	elif shape == 'Cube':
		numFaces += 6
	elif shape == 'Octahedron':
		numFaces += 8
	elif shape == 'Dodecahedron':
		numFaces += 12
	elif shape == 'Icosahedron':
		numFaces += 20
print(numFaces)


num_figures = int(input())
my_figures = []
for x in range(num_figures):
	temp = input()
	my_figures.append(temp)
num_faces = 0
for x in my_figures:
	if x == 'Tetrahedron':
		num_faces += 4
	if x == 'Cube':
		num_faces += 6
	if x == 'Octahedron':
		num_faces += 8
	if x == 'Dodecahedron':
		num_faces += 12
	if x == 'Icosahedron':
		num_faces += 20
print(num_faces)


n = int(input().strip())
t = 0
c = 0
o = 0
d = 0
i = 0
for j in range(n):
	x = input().strip()
	if x[0] == 'T':
		t += 1
	elif x[0] == 'C':
		c += 1
	elif x[0] == 'O':
		o += 1
	elif x[0] == 'D':
		d += 1
	elif x[0] == 'I':
		i += 1
res = t * 4 + c * 6 + o * 8 + d * 12 + i * 20
print(res)


dic = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
c = {'Tetrahedron': 0, 'Cube': 0, 'Octahedron': 0, 'Dodecahedron': 0, 'Icosahedron': 0}
r = 0
n = int(input())
for i in range(n):
	a = input()
	c[a] = c.get(a) + 1
l1 = list(c.values())
l2 = list(dic.values())
for i in range(len(l1)):
	r += l1[i] * l2[i]
print(r)


a = int(input())
b = 'Tetrahedron'
c = 'Cube'
d = 'Octahedron'
e = 'Dodecahedron'
f = 'Icosahedron'
s = 0
for i in range(a):
	x = input()
	if x == b:
		s = s + 4
	if x == c:
		s = s + 6
	if x == d:
		s = s + 8
	if x == e:
		s = s + 12
	if x == f:
		s = s + 20
print(s)


import sys
_ = input()
shapes = [s.strip() for s in sys.stdin.readlines()]
d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
print(sum([d[s] for s in shapes]))


def faces(shape):
	if shape == 'Tetrahedron':
		return 4
	elif shape == 'Cube':
		return 6
	elif shape == 'Octahedron':
		return 8
	elif shape == 'Dodecahedron':
		return 12
	else:
		return 20

def main():
	n = int(input())
	f = 0
	for _ in range(n):
		f += faces(input())
	print(f)
main()


figures = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
sum = 0
for i in range(n):
	name = input()
	sum += figures[name]
print(sum)


n = int(input())
figures = []
values = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
total = 0
i = 0
while i < n:
	figures.append(input())
	total += values[figures[i]]
	i += 1
print(total)


x = int(input())
a = 0
for i in range(x):
	y = input()
	if y == 'Tetrahedron':
		a = a + 4
	if y == 'Cube':
		a = a + 6
	if y == 'Octahedron':
		a = a + 8
	if y == 'Dodecahedron':
		a = a + 12
	if y == 'Icosahedron':
		a = a + 20
print(a)


n = int(input())
r = 0
for i in range(n):
	ch = input()
	if ch == 'Tetrahedron':
		r += 4
	if ch == 'Cube':
		r += 6
	if ch == 'Octahedron':
		r += 8
	if ch == 'Dodecahedron':
		r += 12
	if ch == 'Icosahedron':
		r += 20
print(r)


from sys import stdin
_input = stdin.readline
(_int, _range) = (int, range)

def solution():
	d = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
	ans = 0
	for i in _range(_int(_input())):
		s = _input()
		ans += d[s[0]]
	print(ans)
solution()


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def main():
	n = I()
	a = [S() for _ in range(n)]
	d = {}
	d['Tetrahedron'] = 4
	d['Cube'] = 6
	d['Octahedron'] = 8
	d['Dodecahedron'] = 12
	d['Icosahedron'] = 20
	r = 0
	for c in a:
		r += d[c]
	return r
print(main())


n_faces = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
tot_faces = 0
for i in range(n):
	tot_faces += n_faces[input()]
print(str(tot_faces))


import sys
t = int(sys.stdin.readline())
shapes = ['Tetrahedron\n', 'Cube\n', 'Octahedron\n', 'Dodecahedron\n', 'Icosahedron\n']
face = [4, 6, 8, 12, 20]
res = 0
for i in range(0, t):
	s = str(sys.stdin.readline())
	for j in range(0, 5):
		if s == shapes[j]:
			res += face[j]
print(res)


def Polyhedran(name):
	if name == 'Tetrahedron':
		return 4
	if name == 'Cube':
		return 6
	if name == 'Octahedron':
		return 8
	if name == 'Dodecahedron':
		return 12
	if name == 'Icosahedron':
		return 20
n = int(input())
total = 0
for i in range(n):
	val = Polyhedran(input())
	total += val
print(total)


n = int(input())
k = 0
for i in range(n):
	s = input()
	if s == 'Icosahedron':
		k += 20
	elif s == 'Dodecahedron':
		k += 12
	elif s == 'Octahedron':
		k += 8
	elif s == 'Cube':
		k += 6
	else:
		k += 4
print(k)


noos = int(input())
a = []
for n in range(noos):
	b = str(input())
	a.append(b)
shapes = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
shapes_sides = [4, 6, 8, 12, 20]
sides = 0
for n in range(5):
	x = a.count(shapes[n])
	sides = sides + x * shapes_sides[n]
print(sides)


def main():
	switcher = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	sum = 0
	for i in range(int(input())):
		sum += switcher.get(input())
	print(sum)
main()


a = input()
dico = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
somme = 0
for i in range(int(a)):
	b = input()
	for (k, v) in dico.items():
		if b == k:
			somme += v
print(somme)


dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
sum = 0
for _ in range(n):
	sum += dict[input()]
print(str(sum))


n = int(input())
m = 0
while n:
	name = input()
	if name == 'Icosahedron':
		m = m + 20
	elif name == 'Dodecahedron':
		m = m + 12
	elif name == 'Octahedron':
		m = m + 8
	elif name == 'Cube':
		m = m + 6
	elif name == 'Tetrahedron':
		m = m + 4
	n = n - 1
print(m)


n = int(input())
list1 = []
for i in range(n):
	list1.append(input())
tong = list1.count('Tetrahedron') * 4 + list1.count('Cube') * 6 + list1.count('Octahedron') * 8 + list1.count('Dodecahedron') * 12 + list1.count('Icosahedron') * 20
print(tong)


n = int(input())
ans = 0
polygon = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for _ in range(n):
	type = input()
	ans += polygon[type]
print(ans)


a = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
c = 0
for _ in range(int(input())):
	c += a[input()[0]]
print(c)


from sys import stdin
all_in = list(map(lambda x: x.rstrip('\n'), stdin.readlines()))
n = int(all_in[0])
s = all_in[1:]
mnog = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
print(sum(map(lambda x: mnog[x], s)))


n = int(input())
s = 0
for i in range(n):
	x = input()
	if x == 'Icosahedron':
		s += 20
	elif x == 'Cube':
		s += 6
	elif x == 'Tetrahedron':
		s += 4
	elif x == 'Octahedron':
		s += 8
	else:
		s += 12
print(s)


import math
n = int(input())
z = 0
while n > 0:
	x = input()
	if x == 'Tetrahedron':
		z = z + 4
	if x == 'Cube':
		z = z + 6
	if x == 'Octahedron':
		z = z + 8
	if x == 'Dodecahedron':
		z = z + 12
	if x == 'Icosahedron':
		z = z + 20
	n = n - 1
print(z)


num = int(input())
f = []
count = 0
for x in range(0, num):
	n = input()
	f.append(n)
for x in f:
	if x == 'Icosahedron':
		count += 20
	if x == 'Cube':
		count += 6
	if x == 'Octahedron':
		count += 8
	if x == 'Tetrahedron':
		count += 4
	if x == 'Dodecahedron':
		count += 12
print(count)


n = int(input())
figures = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
k = [4, 6, 8, 12, 20]
s = 0
for i in range(n):
	f = input()
	s += k[figures.index(f)]
print(s)


v = []
z = int(input())
for x in range(z):
	c = str(input())
	v.append(c)
b1 = v.count('Tetrahedron')
b2 = v.count('Cube')
b3 = v.count('Octahedron')
b4 = v.count('Dodecahedron')
b5 = v.count('Icosahedron')
print(4 * b1 + 6 * b2 + b3 * 8 + 12 * b4 + 20 * b5)


d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
sum = 0
for _ in range(n):
	string = input()
	if string in d.keys():
		sum += d[string]
print(sum)


a = int(input())
b = {'Icosahedron': 20, 'Cube': 6, 'Tetrahedron': 4, 'Octahedron': 8, 'Dodecahedron': 12}
sum = 0
for i in range(0, a):
	c = input()
	if c in b.keys():
		sum += b[c]
print(sum, end='\n')


o = int(input())
ls = [input()[0] for y in range(o)]
V = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
sum = 0
for val in ls:
	sum += V[val]
print(sum)


n = int(input())
total = 0
for i in range(n):
	shape = input()
	if shape[0] == 'I':
		total += 20
	elif shape[0] == 'D':
		total += 12
	elif shape[0] == 'O':
		total += 8
	elif shape[0] == 'C':
		total += 6
	else:
		total += 4
print(total)


conversion = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}

def solution(n):
	count = 0
	for i in range(n):
		count += conversion[input()]
	print(count)
solution(int(input()))


n = int(input())
polyhedron = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
faces = 0
for i in range(n):
	x = input()
	for key in polyhedron.keys():
		if x == key:
			faces = faces + polyhedron[key]
print(faces)


n = int(input())
q = dict()
q['Tetrahedron'] = 4
q['Cube'] = 6
q['Octahedron'] = 8
q['Dodecahedron'] = 12
q['Icosahedron'] = 20
k = 0
for i in range(n):
	a = input()
	k += q[a]
print(k)


antonCollectionSum = int(input())
faces = 0
for i in range(antonCollectionSum):
	polyHedron = input()
	polyHedron = polyHedron.lower()
	if polyHedron == 'tetrahedron':
		faces = faces + 4
	elif polyHedron == 'cube':
		faces = faces + 6
	elif polyHedron == 'octahedron':
		faces = faces + 8
	elif polyHedron == 'dodecahedron':
		faces = faces + 12
	elif polyHedron == 'icosahedron':
		faces = faces + 20
print(faces)


from sys import stdin
mapF = {'Icosahedron': 20, 'Cube': 6, 'Tetrahedron': 4, 'Dodecahedron': 12, 'Octahedron': 8}
num = int(stdin.readline())
faces = 0
for i in range(num):
	faces += mapF[stdin.readline().rstrip()]
print(faces)


s = 0
n = int(input())
for _ in range(n):
	c = input()[0]
	if c == 'T':
		s += 4
	elif c == 'C':
		s += 6
	elif c == 'O':
		s += 8
	elif c == 'D':
		s += 12
	else:
		s += 20
print(s)


n = int(input())
polys = []
face = 0
for i in range(n):
	new_poly = input()
	polys.append(new_poly)
for poly in polys:
	if poly == 'Tetrahedron':
		face += 4
	elif poly == 'Cube':
		face += 6
	elif poly == 'Octahedron':
		face += 8
	elif poly == 'Dodecahedron':
		face += 12
	elif poly == 'Icosahedron':
		face += 20
print(face)


def caras(fg):
	if fg == 'Tetrahedron':
		return 4
	elif fg == 'Cube':
		return 6
	elif fg == 'Octahedron':
		return 8
	elif fg == 'Dodecahedron':
		return 12
	elif fg == 'Icosahedron':
		return 20
x = 0
n = int(input())
for i in range(n):
	x = x + caras(input())
print(x)


def dolboeb(straka):
	d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	return d[straka]
n = int(input())
a = []
num = 0
for i in range(0, n, 1):
	a.append(str(input()))
for i in range(0, len(a), 1):
	num += dolboeb(a[i])
print(num)


dict = {'Icosahedron': 20, 'Dodecahedron': 12, 'Octahedron': 8, 'Cube': 6, 'Tetrahedron': 4}
n = int(input())
count = 0
while n:
	inp = input()
	count += dict[inp]
	n -= 1
print(count)


x = int(input())
result = 0
combos = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(x):
	arg = input()
	result += combos[arg]
print(result)


import sys
data = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
lines = [x.strip() for x in sys.stdin.readlines()]
result = 0
for line in lines[1:]:
	if line in data.keys():
		result += data[line]
sys.stdout.write(str(result) + '\n')


n = int(input())
l = []
for i in range(0, n):
	l.append(input())

def calc_faces(item):
	if item == 'Tetrahedron':
		return 4
	elif item == 'Cube':
		return 6
	elif item == 'Octahedron':
		return 8
	elif item == 'Dodecahedron':
		return 12
	elif item == 'Icosahedron':
		return 20
ans = 0
faces_list = list(map(calc_faces, l))
for i in faces_list:
	ans = ans + int(i)
print(ans)


t = int(input())
c = 0
while t:
	x = input()
	if x == 'Tetrahedron':
		c = c + 4
	elif x == 'Cube':
		c = c + 6
	elif x == 'Octahedron':
		c = c + 8
	elif x == 'Dodecahedron':
		c = c + 12
	elif x == 'Icosahedron':
		c = c + 20
	t = t - 1
print(c)


shapes = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
count = 0
for _ in range(n):
	count += shapes[input()]
print(count)


dct = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
s = []
count = 0
for _ in range(n):
	s.append(input())
for i in range(n):
	name = s[i]
	count += dct[name]
print(count)


c = 0
for i in range(int(input())):
	s = str(input())
	if s == 'Tetrahedron':
		c += 4
	elif s == 'Cube':
		c += 6
	elif s == 'Octahedron':
		c += 8
	elif s == 'Dodecahedron':
		c += 12
	else:
		c += 20
print(c)


t = int(input())
disp = []
for i in range(t):
	n = input()
	if n == 'Tetrahedron':
		disp.append(4)
	elif n == 'Cube':
		disp.append(6)
	elif n == 'Octahedron':
		disp.append(8)
	elif n == 'Dodecahedron':
		disp.append(12)
	elif n == 'Icosahedron':
		disp.append(20)
print(sum(disp))


poly_faces = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
sum_faces = 0
for i in range(int(input())):
	sum_faces += poly_faces[input()]
print(sum_faces)


n = int(input())
ans = 0
for x in range(n):
	name = input()
	if name == 'Tetrahedron':
		ans += 4
	elif name == 'Cube':
		ans += 6
	elif name == 'Octahedron':
		ans += 8
	elif name == 'Dodecahedron':
		ans += 12
	else:
		ans += 20
print(ans)


n = int(input())
figures = list()
for i in range(n):
	figures.append(input())
keys = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
values = [4, 6, 8, 12, 20]
sides = dict(zip(keys, values))
sum = 0
for figure in figures:
	sum += sides[figure]
print(sum)


n = int(input())
total = 0
for i in range(n):
	pol = input()
	if pol == 'Tetrahedron':
		total += 4
	elif pol == 'Dodecahedron':
		total += 12
	elif pol == 'Cube':
		total += 6
	elif pol == 'Octahedron':
		total += 8
	else:
		total += 20
print(total)


def anton(l):
	d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	return sum([d[shape] for shape in l])
data = input()
n = int(data)
counter = 0
for i in range(n):
	input_str = str(input())
	if input_str == 'Tetrahedron':
		counter += 4
	elif input_str == 'Cube':
		counter += 6
	elif input_str == 'Octahedron':
		counter += 8
	elif input_str == 'Dodecahedron':
		counter += 12
	elif input_str == 'Icosahedron':
		counter += 20
print(counter)


inp = input
li = list
iinp = lambda : int(inp())
ent = lambda : map(int, inp().split())
lient = lambda : li(ent())
caras = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = iinp()
res = 0
for _ in range(n):
	res += caras[inp()]
print(res)


n = int(input())
suma = 0
for i in range(n):
	figura = input()
	if figura == 'Cube':
		suma = suma + 6
	elif figura == 'Octahedron':
		suma = suma + 8
	elif figura == 'Tetrahedron':
		suma = suma + 4
	elif figura == 'Dodecahedron':
		suma = suma + 12
	elif figura == 'Icosahedron':
		suma = suma + 20
print(suma)


t = int(input())
dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
total = 0
for i in range(t):
	st = input()
	total = total + dict[st]
print(total)


n = int(input())
side = 0
while n > 0:
	s = str(input())
	if s == 'Tetrahedron':
		side += 4
		n -= 1
	if s == 'Cube':
		side += 6
		n -= 1
	if s == 'Octahedron':
		side += 8
		n -= 1
	if s == 'Dodecahedron':
		side += 12
		n -= 1
	if s == 'Icosahedron':
		side += 20
		n -= 1
print(side)


poly = {'tetrahedron': 4, 'cube': 6, 'octahedron': 8, 'dodecahedron': 12, 'icosahedron': 20}
print(sum([poly[input().lower()] for _ in ' ' * int(input())]))


n = int(input())
faces = 0
while n:
	polyhedron = input()
	if polyhedron[0] == 'T':
		faces += 4
	elif polyhedron[0] == 'C':
		faces += 6
	elif polyhedron[0] == 'O':
		faces += 8
	elif polyhedron[0] == 'D':
		faces += 12
	elif polyhedron[0] == 'I':
		faces += 20
	n -= 1
print(faces)


a = int(input())
count = 0
for i in range(0, a):
	b = str(input())
	if b == 'Icosahedron':
		count = count + 20
	if b == 'Cube':
		count = count + 6
	if b == 'Tetrahedron':
		count = count + 4
	if b == 'Dodecahedron':
		count = count + 12
	if b == 'Octahedron':
		count = count + 8
print(count)


n = int(input())
s = 0
for _ in range(1, n + 1):
	x = input()
	if 'Tetra' in x:
		s += 4
	elif 'Octa' in x:
		s += 8
	elif 'Cube' in x:
		s += 6
	elif 'Dode' in x:
		s += 12
	elif 'Icosa' in x:
		s += 20
print(s)


a = int(input())
z = []
for i in range(a):
	x = input()
	if x == 'Tetrahedron':
		z.append(4)
	elif x == 'Cube':
		z.append(6)
	elif x == 'Octahedron':
		z.append(8)
	elif x == 'Dodecahedron':
		z.append(12)
	else:
		z.append(20)
print(sum(z))


import sys
shapes = [sys.stdin.readline().strip() for _ in range(int(sys.stdin.readline().strip()))]
total = 0
faces = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for s in shapes:
	total += faces[s]
print(total)


n = int(input())

def f(n):
	global list
	list = []
	for i in range(n):
		x = input()
		list.append(str(x))
f(n)
Tetra = 4
Cube = 6
Octa = 8
Dode = 12
Ico = 20
somme = 0
for i in range(len(list)):
	if list[i] == 'Tetrahedron':
		somme += Tetra
	elif list[i] == 'Cube':
		somme += Cube
	elif list[i] == 'Octahedron':
		somme += Octa
	elif list[i] == 'Dodecahedron':
		somme += Dode
	elif list[i] == 'Icosahedron':
		somme += Ico
print(somme)


numero = int(input())
cuenta = 0
for i in range(numero):
	poligono = str(input())
	if poligono == 'Tetrahedron':
		cuenta = 4 + cuenta
	elif poligono == 'Cube':
		cuenta = cuenta + 6
	elif poligono == 'Octahedron':
		cuenta = cuenta + 8
	elif poligono == 'Dodecahedron':
		cuenta = cuenta + 12
	elif poligono == 'Icosahedron':
		cuenta = cuenta + 20
print(cuenta)


N = int(input())
lst = []
for _ in range(0, N, 1):
	lst.append(input())
print(lst.count('Tetrahedron') * 4 + lst.count('Cube') * 6 + lst.count('Octahedron') * 8 + lst.count('Dodecahedron') * 12 + lst.count('Icosahedron') * 20)


n = int(input())
faces = 0
for polyhedrons in range(n):
	polyhedron = input()
	if polyhedron == 'Tetrahedron':
		faces += 4
	elif polyhedron == 'Cube':
		faces += 6
	elif polyhedron == 'Octahedron':
		faces += 8
	elif polyhedron == 'Dodecahedron':
		faces += 12
	elif polyhedron == 'Icosahedron':
		faces += 20
print(faces)


r = 0
d = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
for i in range(int(input())):
	r += d[input()[0]]
print(r)


n = int(input())
List = []
a = 0
for i in range(0, n):
	List = input()
	if List[0] == 'T':
		a += 4
	if List[0] == 'C':
		a += 6
	if List[0] == 'O':
		a += 8
	if List[0] == 'D':
		a += 12
	if List[0] == 'I':
		a += 20
print(a)


t = int(input())
sum = 0
for i in range(t):
	st = input()
	if st[0] == 'T':
		sum += 4
	if st[0] == 'C':
		sum += 6
	if st[0] == 'O':
		sum += 8
	if st[0] == 'D':
		sum += 12
	if st[0] == 'I':
		sum += 20
print(sum)


a = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
sum = 0
test_cases = int(input())
for i in range(test_cases):
	shape = input()
	sum += a[shape]
print(sum)


ll = [4, 6, 8, 12, 20]
s = 0
for _ in range(int(input())):
	k = input()
	k = k[0]
	if k == 'T':
		i = 0
	elif k == 'C':
		i = 1
	elif k == 'O':
		i = 2
	elif k == 'D':
		i = 3
	else:
		i = 4
	s += ll[i]
print(s)


n = int(input())
polyhedrons = list()
polyhedronsides = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for _ in range(0, n):
	polyhedron = input()
	polyhedrons.append(polyhedron)
sidecount = 0
for polyhedron in polyhedrons:
	sidecount += polyhedronsides[polyhedron]
print(sidecount)


def get_number():
	return int(input())

def get_numbers():
	return list(map(int, input().split()))
n = get_number()
ans = 0
for i in range(n):
	s = input()
	if s == 'Tetrahedron':
		ans += 4
	elif s == 'Cube':
		ans += 6
	elif s == 'Octahedron':
		ans += 8
	elif s == 'Dodecahedron':
		ans += 12
	elif s == 'Icosahedron':
		ans += 20
print(ans)


n = int(input())
ans = 0
d = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
for i in range(n):
	s = str(input())
	ans += d[s[0]]
print(ans)


n = int(input())
face = 0
for i in range(0, n):
	poly = input()
	if poly == 'Tetrahedron':
		face += 4
	if poly == 'Cube':
		face += 6
	if poly == 'Octahedron':
		face += 8
	if poly == 'Dodecahedron':
		face += 12
	if poly == 'Icosahedron':
		face += 20
print(face)


a = int(input())
ans = 0
face = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(a):
	k = input()
	if k in face:
		ans += face[k]
print(ans)


a = int(input())
s = 0
for i in range(a):
	b = input()
	if b == 'Icosahedron':
		s = s + 20
	elif b == 'Cube':
		s = s + 6
	elif b == 'Tetrahedron':
		s = s + 4
	elif b == 'Dodecahedron':
		s = s + 12
	else:
		s = s + 8
print(s)


t = int(input())
k = 0
for kkkk in range(t):
	a = input()
	if a == 'Tetrahedron':
		k += 4
	elif a == 'Cube':
		k += 6
	elif a == 'Octahedron':
		k += 8
	elif a == 'Dodecahedron':
		k += 12
	else:
		k += 20
print(k)


no_of_polyhedrons = int(input())
polyhedrons = []
no_of_faces = 0
for i in range(no_of_polyhedrons):
	polyhedrons.append(input())
	if 'T' in polyhedrons[i]:
		no_of_faces += 4
	elif 'C' in polyhedrons[i]:
		no_of_faces += 6
	elif 'O' in polyhedrons[i]:
		no_of_faces += 8
	elif 'D' in polyhedrons[i]:
		no_of_faces += 12
	elif 'I' in polyhedrons[i]:
		no_of_faces += 20
print(no_of_faces)


first_input = int(input())
Tetrahedron_f = 4
Cube_f = 6
Octahedron_f = 8
Dodecahedron_f = 12
Icosahedron_f = 20
total_faces = 0
for index in range(first_input):
	name_input = input()
	if name_input == 'Tetrahedron':
		total_faces += Tetrahedron_f
	if name_input == 'Cube':
		total_faces += Cube_f
	if name_input == 'Octahedron':
		total_faces += Octahedron_f
	if name_input == 'Dodecahedron':
		total_faces += Dodecahedron_f
	if name_input == 'Icosahedron':
		total_faces += Icosahedron_f
print(int(total_faces))


n = int(input())
faces = 0
fc_dict = {'Cube': 6, 'Tetrahedron': 4, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for _ in range(n):
	s = input()
	faces += fc_dict[s]
print(faces)


import math
m = input()
m = int(m)
sum = 0
for i in range(0, m):
	k = input()
	if k == 'Icosahedron':
		sum += 20
	elif k == 'Dodecahedron':
		sum += 12
	elif k == 'Octahedron':
		sum += 8
	elif k == 'Cube':
		sum += 6
	else:
		sum += 4
print(sum)


number = int(input())
number_of_faces = 0
cubes = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
faces = [4, 6, 8, 12, 20]
for i in range(number):
	cube = input()
	number_of_faces += faces[cubes.index(cube)]
print(number_of_faces)


import math
x = list(map(int, input().split()))
s = []
counter = 0
for i in range(0, x[0]):
	s.append(input())
for i in range(0, x[0]):
	if s[i] == 'Tetrahedron':
		counter = counter + 4
	elif s[i] == 'Cube':
		counter = counter + 6
	elif s[i] == 'Octahedron':
		counter = counter + 8
	elif s[i] == 'Dodecahedron':
		counter = counter + 12
	elif s[i] == 'Icosahedron':
		counter = counter + 20
print(counter)


import sys
queries = int(sys.stdin.readline())
answer = 0
for query in range(queries):
	polyhedron = sys.stdin.readline().strip()
	if polyhedron == 'Tetrahedron':
		answer += 4
	elif polyhedron == 'Cube':
		answer += 6
	elif polyhedron == 'Octahedron':
		answer += 8
	elif polyhedron == 'Dodecahedron':
		answer += 12
	elif polyhedron == 'Icosahedron':
		answer += 20
print(answer)


l = 0
k = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for _ in range(int(input())):
	l += k[input()]
print(l)


n = int(input())
poly = ['T', 'C', 'O', 'D', 'I']
faces = [4, 6, 8, 12, 20]
print(sum((faces[poly.index(input()[0])] for i in range(n))))


d = {'I': 20, 'D': 12, 'O': 8, 'C': 6, 'T': 4}
n = int(input())
s = [d[input()[0]] for _ in range(n)]
print(sum(s))


n = int(input())
total = 0
for i in range(n):
	fig = input().upper()
	if fig[0] == 'T':
		total += 4
	elif fig[0] == 'C':
		total += 6
	elif fig[0] == 'O':
		total += 8
	elif fig[0] == 'D':
		total += 12
	elif fig[0] == 'I':
		total += 20
print(total)


n = int(input())
buf = 0
for i in range(n):
	b = input()[0]
	if b == 'T':
		buf += 4
	elif b == 'C':
		buf += 6
	elif b == 'O':
		buf += 8
	elif b == 'D':
		buf += 12
	elif b == 'I':
		buf += 20
print(buf)


import sys, functools
n = int(input())
mapping = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
shapes = []
for i in range(n):
	shape = sys.stdin.readline().rstrip()
	shapes.append(shape)
result = functools.reduce(lambda sum, name: sum + mapping[name], shapes, 0)
print(result)


n = int(input())
geometric_figures = []
for i in range(n):
	geometric_figure = str(input())
	geometric_figures.append(geometric_figure)
total_faces = 0
for i in geometric_figures:
	if i == 'Tetrahedron':
		total_faces = total_faces + 4
	elif i == 'Cube':
		total_faces = total_faces + 6
	elif i == 'Octahedron':
		total_faces = total_faces + 8
	elif i == 'Dodecahedron':
		total_faces = total_faces + 12
	else:
		total_faces = total_faces + 20
print(total_faces)


def ReturnNumberOfFaces(polygon):
	if polygon == 'Tetrahedron':
		return 4
	elif polygon == 'Cube':
		return 6
	elif polygon == 'Octahedron':
		return 8
	elif polygon == 'Dodecahedron':
		return 12
	else:
		return 20
n = int(input())
result = 0
while n > 0:
	polygon = input()
	result += ReturnNumberOfFaces(polygon)
	n -= 1
print(result)


n = int(input())
l = list()
for i in range(n):
	x = input()
	l.append(x)
t = l.count('Tetrahedron')
c = l.count('Cube')
o = l.count('Octahedron')
d = l.count('Dodecahedron')
i = l.count('Icosahedron')
print(4 * t + 6 * c + 8 * o + 12 * d + 20 * i)


n = int(input())
g_figures = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
t = 0
for x in range(n):
	s = g_figures.get(input())
	t += s
print(t)


numPoly = int(input())
listPoly = list()
faces = 0
for i in range(numPoly):
	polygon = input()
	listPoly.append(polygon)
	if listPoly[i] == 'Tetrahedron':
		faces += 4
	elif listPoly[i] == 'Cube':
		faces += 6
	elif listPoly[i] == 'Octahedron':
		faces += 8
	elif listPoly[i] == 'Dodecahedron':
		faces += 12
	elif listPoly[i] == 'Icosahedron':
		faces += 20
print(faces)


n = int(input().strip())
d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
ans = 0
for i in range(n):
	p = input().strip()
	ans += d.get(p, 0)
print(ans)


def cal_faces_num(faces):
	res = 0
	for i in range(len(faces)):
		if faces[i] == 'Tetrahedron':
			res += 4
		elif faces[i] == 'Cube':
			res += 6
		elif faces[i] == 'Octahedron':
			res += 8
		elif faces[i] == 'Dodecahedron':
			res += 12
		elif faces[i] == 'Icosahedron':
			res += 20
	print(res)
num_of_shapes = int(input())
shape_names = []
for i in range(num_of_shapes):
	shape_names.append(input())
cal_faces_num(shape_names)


def main():
	n = int(input())
	FIGS = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	sum = 0
	for _ in range(n):
		sum += FIGS[input()]
	print(sum)
main()


num_times = int(input())
count = 0
total = 0
while count < num_times:
	shape = input()
	if shape == 'Tetrahedron':
		total += 4
	elif shape == 'Cube':
		total += 6
	elif shape == 'Octahedron':
		total += 8
	elif shape == 'Dodecahedron':
		total += 12
	elif shape == 'Icosahedron':
		total += 20
	count += 1
print(str(total))


n = int(input())
ans = 0
for x in range(n):
	a = input()
	if a == 'Icosahedron':
		ans += 20
	if a == 'Cube':
		ans += 6
	if a == 'Tetrahedron':
		ans += 4
	if a == 'Dodecahedron':
		ans += 12
	if a == 'Octahedron':
		ans += 8
print(ans)


n = int(input())
summant = 0
for i in range(n):
	pole = input()
	if pole == 'Tetrahedron':
		summant += 4
	if pole == 'Cube':
		summant += 6
	if pole == 'Octahedron':
		summant += 8
	if pole == 'Dodecahedron':
		summant += 12
	if pole == 'Icosahedron':
		summant += 20
print(summant)


n = int(input())
i = []
k = 0
q = 0
while k < n:
	a = input()
	i.append(a)
	if a == 'Tetrahedron':
		q = q + 4
	elif a == 'Cube':
		q = q + 6
	elif a == 'Octahedron':
		q = q + 8
	elif a == 'Dodecahedron':
		q = q + 12
	elif a == 'Icosahedron':
		q = q + 20
	k = k + 1
print(q)


class CodeforcesTask785ASolution:

	def __init__(self):
		self.result = ''
		self.n = 0
		self.polyhedrons = []

	def read_input(self):
		self.n = int(input())
		for x in range(self.n):
			self.polyhedrons.append(input())

	def process_task(self):
		polyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
		faces = 0
		for p in self.polyhedrons:
			faces += polyhedrons[p]
		self.result = str(faces)

	def get_result(self):
		return self.result
Solution = CodeforcesTask785ASolution()
Solution.read_input()
Solution.process_task()
print(Solution.get_result())


c = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
k = 0
for i in range(int(input())):
	a = input()
	k += c.get(a)
print(k)


dt = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = input()
n = int(n)
sum = 0
for x in range(n):
	str = input()
	sum += dt[str]
print(sum)


hat = int(input())
lst = []
score = 0
for i in range(hat):
	lst.append(input())
for i in range(hat):
	if lst[i] == 'Tetrahedron':
		score += 4
	elif lst[i] == 'Cube':
		score += 6
	elif lst[i] == 'Octahedron':
		score += 8
	elif lst[i] == 'Dodecahedron':
		score += 12
	elif lst[i] == 'Icosahedron':
		score += 20
print(score)


mapping = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}

def main():
	n = int(input())
	total = 0
	for i in range(n):
		shape = input()
		total += mapping.get(shape)
	print(total)
main()


n = int(input())
count = 0
for i in range(n):
	temp = str(input())
	if temp == 'Tetrahedron':
		count += 4
	if temp == 'Cube':
		count += 6
	if temp == 'Dodecahedron':
		count += 12
	if temp == 'Octahedron':
		count += 8
	if temp == 'Icosahedron':
		count += 20
print(count)


i = int(input())
result = 0
for i in range(0, i):
	str = input()
	if str[0] == 'T':
		result += 4
	elif str[0] == 'C':
		result += 6
	elif str[0] == 'O':
		result += 8
	elif str[0] == 'D':
		result += 12
	elif str[0] == 'I':
		result += 20
print(result)


def main():
	QWE = 'insert'
	INF = 10 ** 9 + 9
	EPS = 10 ** (-10)
	import sys, math, re
	n = int(input())
	d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	rez = 0
	for i in range(n):
		s = input()
		rez += d[s]
	print(rez)
main()


polyhedronsFaces = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
total = 0
for i in range(n):
	poly = input()
	total += polyhedronsFaces.get(poly)
print(total)


number = int(input())
answer = 0
for n in range(number):
	sentens = input()
	if sentens == 'Tetrahedron':
		answer += 4
	elif sentens == 'Cube':
		answer += 6
	elif sentens == 'Octahedron':
		answer += 8
	elif sentens == 'Dodecahedron':
		answer += 12
	else:
		answer += 20
print(answer)


x = int(input())
c = 0
for _ in range(x):
	y = input()
	if y[0] == 'T':
		c += 4
	elif y[0] == 'C':
		c += 6
	elif y[0] == 'O':
		c += 8
	elif y[0] == 'D':
		c += 12
	elif y[0] == 'I':
		c += 20
print(c)


import sys
input = 'Cube'
num = sys.stdin.readline()
dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
sum = 0
for line in sys.stdin.readlines():
	sum += dict[line.strip()]
sys.stdout.write(str(sum))


t = int(input())
l = []
for _ in range(t):
	l.append(input())
	pass
s = 0
s += l.count('Tetrahedron') * 4
s += l.count('Cube') * 6
s += l.count('Octahedron') * 8
s += l.count('Dodecahedron') * 12
s += l.count('Icosahedron') * 20
print(s)


num = int(input())
sum = 0
values = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(0, num):
	sum += values[input()]
print(sum)


cnt = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
print(sum([cnt[input()] for x in range(int(input()))]))


n = int(input())
objs = [input() for i in range(n)]
mp = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
res = 0
for o in objs:
	res += mp[o]
print(res)


def AntonFaces(listofChoices):
	dictFaces = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	counter = 0
	for val in listofChoices:
		counter += dictFaces[val]
	return counter

def main():
	totalValues = int(input())
	listofChoices = []
	for index in range(totalValues):
		inputVal = input()
		listofChoices.append(inputVal)
	print(AntonFaces(listofChoices))
main()


def faces_total(faces):
	if faces is None:
		return 0
	faces = [face.lower() for face in faces]
	face_list = {'tetrahedron': 4, 'cube': 6, 'octahedron': 8, 'dodecahedron': 12, 'icosahedron': 20}
	total_faces = 0
	for f in faces:
		if f in face_list:
			total_faces += face_list[f]
		else:
			pass
	return total_faces
total = int(input())
faces = []
for i in range(total):
	faces.append(str(input()))
print(faces_total(faces))


a = int(input())
l = 0
for i in range(0, int(a)):
	s = input()
	if s == 'Tetrahedron':
		l = l + 4
	elif len(s) == 4:
		l = l + 6
	elif len(s) == 10:
		l = l + 8
	elif len(s) == 12:
		l = l + 12
	elif len(s) == 11:
		l = l + 20
print(l)


def faces(ar):
	shapes = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	total = 0
	for i in ar:
		total += shapes.get(i)
	print(total)
count = int(input())
ar = []
for _ in range(0, count):
	ar.append(input())
faces(ar)


n = int(input())
i = 0
k = 0
while i < n:
	f = input()
	if f == 'Tetrahedron':
		k += 4
	elif f == 'Cube':
		k += 6
	elif f == 'Octahedron':
		k += 8
	elif f == 'Dodecahedron':
		k += 12
	elif f == 'Icosahedron':
		k += 20
	i += 1
print(k)


FACES = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}

def anton(shapes):
	return sum((FACES[shape] for shape in shapes))

def main():
	n = int(input())
	shapes = [input() for __ in range(n)]
	num_faces = anton(shapes)
	print(num_faces)
main()


n = int(input(''))
coll = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
total = 0
for item in range(1, n + 1):
	total += coll[input()]
print(total)


n = int(input())
figures = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
faces = [4, 6, 8, 12, 20]
amount = 0
while n > 0:
	g = input()
	i = figures.index(g)
	f = faces[i]
	amount += f
	n -= 1
print(amount)


n = int(input())
i = 1
face = 0
if n >= 1 and n <= 200000:
	while i <= n:
		s = input()
		if s == 'Tetrahedron':
			face += 4
		elif s == 'Cube':
			face += 6
		elif s == 'Octahedron':
			face += 8
		elif s == 'Dodecahedron':
			face += 12
		elif s == 'Icosahedron':
			face += 20
		i += 1
	print(face)


n = int(input())
d = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
sum = 0
while n:
	sum += d[input()[:1]]
	n -= 1
print(sum)


n = int(input())
l = {'I': 20, 'D': 12, 'O': 8, 'C': 6, 'T': 4}
sides = 0
for _ in range(n):
	shape = input()
	sides += l[shape[0]]
print(sides)


vals = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
ar = []
sum = 0
n = int(input())
for layer in range(n):
	sum += vals[input()]
print(sum)


n = int(input())
dic = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
t = 0
num = 0
while t < n:
	num = num + dic[input()]
	t = t + 1
print(num)


import sys
n = int(input())
ans = 0
for i in range(n):
	s = input()
	if s == 'Tetrahedron':
		ans += 4
	elif s == 'Cube':
		ans += 6
	elif s == 'Octahedron':
		ans += 8
	elif s == 'Dodecahedron':
		ans += 12
	else:
		ans += 20
print(ans)


n = int(input())
sum = 0
for i in range(0, n):
	line = input()
	if line[0] == 'T':
		sum += 4
	elif line[0] == 'C':
		sum += 6
	elif line[0] == 'O':
		sum += 8
	elif line[0] == 'D':
		sum += 12
	else:
		sum += 20
print(sum)


t = int(input())
c = 0
for _ in range(t):
	s = input()
	if s == 'Tetrahedron':
		c += 4
	elif s == 'Octahedron':
		c += 8
	elif s == 'Dodecahedron':
		c += 12
	elif s == 'Icosahedron':
		c += 20
	else:
		c += 6
print(c)


d = dict(zip(['T', 'C', 'O', 'D', 'I'], [4, 6, 8, 12, 20]))
print(sum((d[input()[0]] for _ in range(int(input())))))


def answer():
	c = []
	a = int(input())
	while a:
		b = input()
		c.append(b)
		a -= 1
	a = 0
	for x in c:
		if x == 'Tetrahedron':
			a += 4
		elif x == 'Cube':
			a += 6
		elif x == 'Octahedron':
			a += 8
		elif x == 'Dodecahedron':
			a += 12
		elif x == 'Icosahedron':
			a += 20
	ans = a
	return ans
print(answer())


n = int(input())
list = []
sum = 0
for i in range(n):
	list.append(str(input()))
for i in list:
	if i == 'Cube':
		sum = sum + 6
	elif i == 'Tetrahedron':
		sum = sum + 4
	elif i == 'Octahedron':
		sum = sum + 8
	elif i == 'Dodecahedron':
		sum = sum + 12
	else:
		sum = sum + 20
print(sum)


ALLOWED_FIGURES2 = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}

def main():
	sum = 0
	n = input()
	for i in range(int(n)):
		sum += ALLOWED_FIGURES2[input()]
	print(sum)
main()


total = int(input())
totalcounter = 0
faces = 0
while total != totalcounter:
	totalcounter = totalcounter + 1
	shape = str(input())
	if shape == 'Tetrahedron':
		faces = faces + 4
	elif shape == 'Cube':
		faces = faces + 6
	elif shape == 'Octahedron':
		faces = faces + 8
	elif shape == 'Dodecahedron':
		faces = faces + 12
	elif shape == 'Icosahedron':
		faces = faces + 20
print(faces)


n = int(input())
ar = []
sum = 0
for i in range(n):
	s = input()
	ar.append(s)
for i in range(n):
	if ar[i] == 'Icosahedron':
		sum = sum + 20
	elif ar[i] == 'Cube':
		sum = sum + 6
	elif ar[i] == 'Tetrahedron':
		sum = sum + 4
	elif ar[i] == 'Dodecahedron':
		sum = sum + 12
	else:
		sum = sum + 8
print(sum)


n = int(input())
i = 0
sum = 0
while i < n:
	figure = input()
	if figure == 'Tetrahedron':
		sum += 4
	elif figure == 'Cube':
		sum += 6
	elif figure == 'Octahedron':
		sum += 8
	elif figure == 'Dodecahedron':
		sum += 12
	elif figure == 'Icosahedron':
		sum += 20
	i += 1
print(sum)


n = int(input())
sides = 0
for _ in range(n):
	hedron = input()
	if hedron == 'Tetrahedron':
		sides += 4
	if hedron == 'Cube':
		sides += 6
	if hedron == 'Octahedron':
		sides += 8
	if hedron == 'Dodecahedron':
		sides += 12
	if hedron == 'Icosahedron':
		sides += 20
print(sides)


dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
res = 0
for _ in range(int(input())):
	res += dict[input()]
print(res)


ans = 0
for _ in range(int(input())):
	in1 = input()
	if in1 == 'Icosahedron':
		ans += 20
	elif in1 == 'Cube':
		ans += 6
	elif in1 == 'Tetrahedron':
		ans += 4
	elif in1 == 'Dodecahedron':
		ans += 12
	elif in1 == 'Octahedron':
		ans += 8
print(ans)


source = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
target = {'Tetrahedron': 0, 'Cube': 0, 'Octahedron': 0, 'Dodecahedron': 0, 'Icosahedron': 0}
l = [0] * 5
for _ in range(int(input())):
	target[input()] += 1
face = 0
for i in target:
	face += target[i] * source[i]
print(face)


from sys import stdin, stdout
n = int(stdin.readline())
ans = 0
for i in range(n):
	s = stdin.readline().strip()
	if s[0] == 'T':
		ans += 4
	elif s[0] == 'C':
		ans += 6
	elif s[0] == 'O':
		ans += 8
	elif s[0] == 'D':
		ans += 12
	elif s[0] == 'I':
		ans += 20
stdout.write(str(ans))


n = int(input())
a = []
for k in range(n):
	a.append(input())
s = 0
for i in range(n):
	if a[i] == 'Tetrahedron':
		s = s + 4
	elif a[i] == 'Cube':
		s = s + 6
	elif a[i] == 'Octahedron':
		s = s + 8
	elif a[i] == 'Dodecahedron':
		s = s + 12
	elif a[i] == 'Icosahedron':
		s = s + 20
	else:
		print('other figure')
print(s)


n = int(input())
res = 0
figs = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for _ in range(n):
	res += figs[input()]
print(str(res))


c = 0
for i in range(int(input())):
	k = input()
	res = ['Icosahedron', 'Cube', 'Tetrahedron', 'Dodecahedron', 'Octahedron']
	res1 = [20, 6, 4, 12, 8]
	s1 = res.index(k)
	c += res1[s1]
print(c)


no = int(input())
nos = 0
for i in range(no):
	p = input()
	if p == 'Tetrahedron':
		nos += 4
	elif p == 'Cube':
		nos += 6
	elif p == 'Octahedron':
		nos += 8
	elif p == 'Dodecahedron':
		nos += 12
	elif p == 'Icosahedron':
		nos += 20
print(nos)


import sys
input = sys.stdin.readline

def main():
	dic = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	ans = 0
	for _ in range(int(input())):
		ans += dic[input().strip()]
	print(ans)
main()


d = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
n = eval(input())
a = 0
word = []
for i in range(n):
	word.append(input())
for i in range(n):
	if word[i] == d[0]:
		a = a + 4
for i in range(n):
	if word[i] == d[1]:
		a = a + 6
for i in range(n):
	if word[i] == d[2]:
		a = a + 8
for i in range(n):
	if word[i] == d[3]:
		a = a + 12
for i in range(n):
	if word[i] == d[4]:
		a = a + 20
print(a)


num = int(input())
total = 0
lookup = {'t': 4, 'c': 6, 'o': 8, 'd': 12, 'i': 20}
for i in range(num):
	total += lookup[input()[0].lower()]
print(total)


d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
l = []
for _ in range(n):
	l.append(input())
print(sum((d[i] for i in l)))


figuresDict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
totalFigures = int(input())
mainRes = 0
for a in range(totalFigures):
	figName = input()
	mainRes = mainRes + figuresDict.get(figName)
print(mainRes)


gdict = {'Tetrahedron': '4', 'Cube': '6', 'Octahedron': '8', 'Dodecahedron': '12', 'Icosahedron': '20'}
n = int(input())
sumi = 0
for i in range(0, n):
	gstr = str(input())
	sumi = sumi + int(gdict[gstr])
print(sumi)


def main():
	n = int(input())
	d = {}
	d['Tetrahedron'] = 4
	d['Cube'] = 6
	d['Octahedron'] = 8
	d['Dodecahedron'] = 12
	d['Icosahedron'] = 20
	ans = 0
	for i in range(n):
		t = input()
		ans += d[t]
	print(ans)
	return

def __starting_point():
	main()
__starting_point()


n = int(input())
list = []
summa = 0
for i in range(0, n):
	b = input()
	list.append(b)
for j in list:
	if j == 'Tetrahedron':
		summa = summa + 4
	elif j == 'Cube':
		summa = summa + 6
	elif j == 'Octahedron':
		summa = summa + 8
	elif j == 'Dodecahedron':
		summa = summa + 12
	elif j == 'Icosahedron':
		summa = summa + 20
print(summa)


shapes = {'Icosahedron': 20, 'Cube': 6, 'Tetrahedron': 4, 'Octahedron': 8, 'Dodecahedron': 12}
total = 0
for _ in range(int(input())):
	total += shapes[input().strip()]
print(total)


from sys import stdin as inp
from sys import stdout as out
from sys import maxsize as max
d = dict()
d['Tetrahedron'] = 4
d['Cube'] = 6
d['Octahedron'] = 8
d['Dodecahedron'] = 12
d['Icosahedron'] = 20
n = int(inp.readline().strip())
ans = 0
for i in range(n):
	s = inp.readline().strip()
	ans += d[s]
out.write(str(ans))


n = int(input(''))
tot = 0
for i in range(n):
	j = str(input(''))
	if j == 'Tetrahedron':
		tot = tot + 4
	elif j == 'Cube':
		tot = tot + 6
	elif j == 'Octahedron':
		tot = tot + 8
	elif j == 'Dodecahedron':
		tot = tot + 12
	else:
		tot = tot + 20
print(tot)


gmt = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}

def _get_faces(gname):
	return gmt.get(gname)

def sum_faces():
	n = int(input())
	faces = 0
	for _ in range(n):
		gname = input()
		faces += _get_faces(gname)
	return faces

def main():
	print(sum_faces())
main()


p = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
k = int(input())
s = 0
for _ in range(k):
	st = input()
	s += p[st]
print(s)


def shapes(l):
	lt = 0
	lc = 0
	lo = 0
	ld = 0
	li = 0
	for i in range(0, len(l)):
		if l[i] == 'Tetrahedron':
			lt += 1
		elif l[i] == 'Cube':
			lc += 1
		elif l[i] == 'Octahedron':
			lo += 1
		elif l[i] == 'Dodecahedron':
			ld += 1
		else:
			li += 1
	return lt * 4 + lc * 6 + lo * 8 + ld * 12 + li * 20
n = int(input())
l = []
for j in range(0, n):
	a = input()
	l.append(a)
	a = ''
print(shapes(l))


n = int(input().strip())
sum = 0
for i in range(n):
	name = input().strip()
	if name == 'Tetrahedron':
		sum += 4
	elif name == 'Cube':
		sum += 6
	elif name == 'Octahedron':
		sum += 8
	elif name == 'Dodecahedron':
		sum += 12
	elif name == 'Icosahedron':
		sum += 20
print(sum)


k = 0
t = int(input())
for e in range(0, t):
	d = input()
	if d == 'Tetrahedron':
		k = k + 4
	if d == 'Cube':
		k = k + 6
	if d == 'Octahedron':
		k = k + 8
	if d == 'Icosahedron':
		k = k + 20
	if d == 'Dodecahedron':
		k = k + 12
print(k)


def getNumFace(poly):
	if poly == 'Tetrahedron':
		return 4
	elif poly == 'Cube':
		return 6
	elif poly == 'Octahedron':
		return 8
	elif poly == 'Dodecahedron':
		return 12
	else:
		return 20
n = int(input())
faces = 0
for i in range(n):
	faces += getNumFace(input())
print(faces)


def ii():
	return int(input())

def fi():
	return float(input())

def si():
	return input()

def mi():
	return map(int, input().split())

def li():
	return list(mi())
n = ii()
c = 0
while n:
	s = si()
	if s == 'Tetrahedron':
		c += 4
	elif s == 'Cube':
		c += 6
	elif s == 'Octahedron':
		c += 8
	elif s == 'Dodecahedron':
		c += 12
	else:
		c += 20
	n -= 1
print(c)


n = int(input())
m = 0
for i in range(n):
	t = str(input())
	if t.startswith('T'):
		m += 4
	elif t.startswith('C'):
		m += 6
	elif t.startswith('O'):
		m += 8
	elif t.startswith('D'):
		m += 12
	elif t.startswith('I'):
		m += 20
	else:
		pass
print(m)


print(sum(([4, 0, 8, 20, 6, 12][ord(s[0]) % 7] for s in (input() for i in range(int(input()))))))


n = int(input())
d = {'Tetrahedron': 0, 'Cube': 0, 'Octahedron': 0, 'Dodecahedron': 0, 'Icosahedron': 0}
for _ in range(n):
	d[input().strip()] += 1
ret = 4 * d['Tetrahedron'] + 6 * d['Cube'] + 8 * d['Octahedron'] + 12 * d['Dodecahedron'] + 20 * d['Icosahedron']
print(ret)


shapes = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
x = int(input())
s = 0
for i in range(x):
	s = s + shapes[input()]
print(s)


count = 0
n = int(input())
for i in range(n):
	ss = input()
	if ss == 'Tetrahedron':
		count += 4
	elif ss == 'Cube':
		count += 6
	elif ss == 'Octahedron':
		count += 8
	elif ss == 'Dodecahedron':
		count += 12
	else:
		count += 20
print(count)


from collections import Counter
source = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
face = 0
s = []
for _ in range(int(input())):
	s.append(input())
s = dict(Counter(s))
for i in s:
	face += s[i] * source[i]
print(face)


polyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
number_polyhedrons = int(input())
list_polyhedrons = []
for i in range(number_polyhedrons):
	list_polyhedrons.append(input())
faces = 0
for i in range(len(list_polyhedrons)):
	faces += polyhedrons[list_polyhedrons[i]]
print(faces)


n = int(input())
faces = 0
for i in range(n):
	hedron = input()
	if hedron == 'Tetrahedron':
		faces += 4
	elif hedron == 'Cube':
		faces += 6
	elif hedron == 'Dodecahedron':
		faces += 12
	elif hedron == 'Octahedron':
		faces += 8
	elif hedron == 'Icosahedron':
		faces += 20
print(faces)


t = int(input())
l = []
s = 0
for i in range(t):
	a = str(input())
	l.append(a)
for items in l:
	if items == 'Tetrahedron':
		s += 4
	elif items == 'Cube':
		s += 6
	elif items == 'Octahedron':
		s += 8
	elif items == 'Dodecahedron':
		s += 12
	else:
		s += 20
print(s)


n = int(input())
array = []
for i in range(n):
	array.append(input())
arra_gran = {'Icosahedron': 20, 'Cube': 6, 'Tetrahedron': 4, 'Dodecahedron': 12, 'Octahedron': 8}
summ = 0
for i in range(n):
	summ += arra_gran[array[i]]
print(summ)


poly_dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
faces = 0
poly_num = int(input())
for i in range(poly_num):
	faces += poly_dict[input()]
print(str(faces))


s = 0
for _ in range(int(input())):
	k = input()
	if k == 'Tetrahedron':
		s = s + 4
	elif k == 'Cube':
		s = s + 6
	elif k == 'Octahedron':
		s = s + 8
	elif k == 'Dodecahedron':
		s = s + 12
	else:
		s = s + 20
print(s)


n = int(input())
faces = 0
for _ in range(n):
	shape = input()
	if shape == 'Tetrahedron':
		faces += 4
	if shape == 'Cube':
		faces += 6
	if shape == 'Octahedron':
		faces += 8
	if shape == 'Dodecahedron':
		faces += 12
	if shape == 'Icosahedron':
		faces += 20
print(faces)


n = int(input())
figures = []
for i in range(n):
	figures.append(input()[0])
figures_map = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
faces = 0
for i in range(len(figures)):
	faces += figures_map[figures[i]]
print(faces)


n = int(input())
faces = 0
while n > 0:
	p = input()
	if p == 'Tetrahedron':
		faces += 4
	elif p == 'Cube':
		faces += 6
	elif p == 'Octahedron':
		faces += 8
	elif p == 'Dodecahedron':
		faces += 12
	else:
		faces += 20
	n -= 1
print(faces)


total = 0
for _ in range(int(input())):
	shape = input()
	if shape[0] == 'T':
		total += 4
	elif shape[0] == 'I':
		total += 20
	elif shape[0] == 'C':
		total += 6
	elif shape[0] == 'O':
		total += 8
	else:
		total += 12
print(str(total))


try:
	sm = 0
	for _ in range(int(input())):
		s = input()
		if s == 'Tetrahedron':
			sm += 4
		if s == 'Cube':
			sm += 6
		if s == 'Octahedron':
			sm += 8
		if s == 'Dodecahedron':
			sm += 12
		if s == 'Icosahedron':
			sm += 20
	print(sm)
except:
	pass


ilosc = int(input())
suma = 0
for i in range(ilosc):
	polyhedron = input()
	if polyhedron == 'Tetrahedron':
		suma += 4
	elif polyhedron == 'Cube':
		suma += 6
	elif polyhedron == 'Octahedron':
		suma += 8
	elif polyhedron == 'Dodecahedron':
		suma += 12
	else:
		suma += 20
print(suma)


n = int(input())
ans = 0
for _ in range(n):
	p = input()
	if p[0] == 'T':
		ans += 4
	elif p[0] == 'C':
		ans += 6
	elif p[0] == 'O':
		ans += 8
	elif p[0] == 'D':
		ans += 12
	else:
		ans += 20
print(ans)


t = int(input())
y = 0
count = 0
while y < t:
	i = input()
	if i == 'Tetrahedron':
		count = count + 4
	if i == 'Octahedron':
		count = count + 8
	if i == 'Dodecahedron':
		count = count + 12
	if i == 'Icosahedron':
		count = count + 20
	if i == 'Cube':
		count = count + 6
	y = y + 1
print(count)


n = int(input())
forms = dict()
forms['Tetrahedron'] = 4
forms['Cube'] = 6
forms['Octahedron'] = 8
forms['Dodecahedron'] = 12
forms['Icosahedron'] = 20
sum = 0
for i in range(n):
	f = input()
	sum += forms[f]
print(sum)


n = input()
a = []
for p in range(int(n)):
	a.append(input())
s = 0
for i in a:
	if i == 'Tetrahedron':
		s += 4
	if i == 'Cube':
		s += 6
	if i == 'Octahedron':
		s += 8
	if i == 'Dodecahedron':
		s += 12
	if i == 'Icosahedron':
		s += 20
print(s)


c = 0
a = int(input())
for i in range(a):
	b = input()
	if b == 'Icosahedron':
		c = c + 20
	elif b == 'Dodecahedron':
		c = c + 12
	elif b == 'Octahedron':
		c = c + 8
	elif b == 'Cube':
		c = c + 6
	else:
		c = c + 4
print(c)


count = 0
for x in range(int(input())):
	a = input()
	if a[0] == 'T':
		count += 4
	elif a[0] == 'C':
		count += 6
	elif a[0] == 'O':
		count += 8
	elif a[0] == 'D':
		count += 12
	else:
		count += 20
print(count)


polyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
result = 0
number = int(input())
i = 0
while i < number:
	shap = input()
	result += polyhedrons.get(shap)
	i += 1
print(result)


n = int(input())
res = 0
dict = {}
for i in range(n):
	t = input()
	if t not in dict:
		dict[t] = 1
	else:
		dict[t] += 1
for t in dict:
	if t == 'Tetrahedron':
		res += 4 * dict[t]
	elif t == 'Cube':
		res += 6 * dict[t]
	elif t == 'Octahedron':
		res += 8 * dict[t]
	elif t == 'Dodecahedron':
		res += 12 * dict[t]
	elif t == 'Icosahedron':
		res += 20 * dict[t]
print(res)


n = int(input())
list = []
list2 = []
for i in range(n):
	list.append(input())
print(list.count('Tetrahedron') * 4 + list.count('Cube') * 6 + list.count('Octahedron') * 8 + list.count('Dodecahedron') * 12 + list.count('Icosahedron') * 20)


numpoly = input()
sumfaces = 0
for x in range(int(numpoly)):
	polyedron = input()
	if str(polyedron) == 'Icosahedron':
		sumfaces = sumfaces + 20
	if polyedron == 'Dodecahedron':
		sumfaces = sumfaces + 12
	if polyedron == 'Octahedron':
		sumfaces = sumfaces + 8
	if polyedron == 'Cube':
		sumfaces = sumfaces + 6
	if polyedron == 'Tetrahedron':
		sumfaces = sumfaces + 4
print(sumfaces)


n = int(input())
l = [input() for i in range(n)]
rj = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
br = 0
for e in l:
	for el in rj.items():
		if el[0] == e:
			br += el[1]
print(br)


n = int(input())
l = []
for x in range(n):
	y = input()
	l.append(y)
z = 0
for x in l:
	if x == 'Cube':
		z += 6
	elif x == 'Tetrahedron':
		z += 4
	elif x == 'Icosahedron':
		z += 20
	elif x == 'Dodecahedron':
		z += 12
	elif x == 'Octahedron':
		z += 8
print(z)


x = input()
x = int(x)
y = 0
for i in range(x):
	polyhedron = input()
	if polyhedron == 'Tetrahedron':
		y += 4
	elif polyhedron == 'Cube':
		y += 6
	elif polyhedron == 'Octahedron':
		y += 8
	elif polyhedron == 'Dodecahedron':
		y += 12
	else:
		y += 20
print(y)


import sys
contador = list()
elementos = list()
lines = sys.stdin.readlines()
for linea in lines:
	c = linea.split()
	c = list(map(str, c))
	elementos.append(c)
figuras = elementos[1:]
for k in range(len(figuras)):
	figura = figuras[k]
	figura = figura[0]
	if figura == 'Icosahedron':
		contador.append(20)
	if figura == 'Cube':
		contador.append(6)
	if figura == 'Tetrahedron':
		contador.append(4)
	if figura == 'Dodecahedron':
		contador.append(12)
	if figura == 'Octahedron':
		contador.append(8)
print(sum(contador))


n = int(input())
sumi = 0
for i in range(n):
	temp = str(input())
	if temp[0] == 'I':
		sumi = sumi + 20
	elif temp[0] == 'D':
		sumi = sumi + 12
	elif temp[0] == 'C':
		sumi = sumi + 6
	elif temp[0] == 'O':
		sumi = sumi + 8
	else:
		sumi = sumi + 4
print(sumi)


x = int(input())
time = 0
calculate = 0
while time < x:
	a = input()
	if a == 'Tetrahedron':
		calculate += 4
	elif a == 'Cube':
		calculate += 6
	elif a == 'Octahedron':
		calculate += 8
	elif a == 'Dodecahedron':
		calculate += 12
	elif a == 'Icosahedron':
		calculate += 20
	time += 1
print(calculate)


faces_count_by_name = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
figures_cnt = int(input())
res = 0
for i in range(figures_cnt):
	res += faces_count_by_name[input()]
print(res)


n = int(input())
num = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
total = 0
for i in range(n):
	hedron = input()
	total = num[hedron] + total
print(total)


n = input()
ans = 0
i = 0
while i < int(n):
	val = input()
	if val == 'Tetrahedron':
		ans = ans + 4
	elif val == 'Cube':
		ans = ans + 6
	elif val == 'Octahedron':
		ans = ans + 8
	elif val == 'Dodecahedron':
		ans = ans + 12
	elif val == 'Icosahedron':
		ans = ans + 20
	i = i + 1
print(ans)


polys = int(input())
faces = 0
for i in range(polys):
	poly = input()
	if poly == 'Tetrahedron':
		faces += 4
	elif poly == 'Cube':
		faces += 6
	elif poly == 'Octahedron':
		faces += 8
	elif poly == 'Dodecahedron':
		faces += 12
	else:
		faces += 20
print(faces)


n = int(input())
c = 0
for i in range(n):
	x = input()
	if x[0] == 'T':
		c += 4
	elif x[0] == 'C':
		c += 6
	elif x[0] == 'O':
		c += 8
	elif x[0] == 'D':
		c += 12
	else:
		c += 20
print(c)


len = int(input())
sum = 0
while len > 0:
	str = input()
	if str == 'Tetrahedron':
		sum += 4
	if str == 'Cube':
		sum += 6
	if str == 'Octahedron':
		sum += 8
	if str == 'Dodecahedron':
		sum += 12
	if str == 'Icosahedron':
		sum += 20
	len -= 1
print(sum)


sum = 0
x = int(input())
for times in range(x):
	y = input()
	if y == 'Tetrahedron':
		sum += 4
	elif y == 'Cube':
		sum += 6
	elif y == 'Octahedron':
		sum += 8
	elif y == 'Dodecahedron':
		sum += 12
	else:
		sum += 20
print(sum)


p = {}
n = int(input())
for x in range(n):
	k = input()
	if k not in p:
		p[k] = 1
	else:
		p[k] += 1
l = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
lo = [4, 6, 8, 12, 20]
sa = []
for item in p:
	sa.append(lo[l.index(item)] * p[item])
print(sum(sa))


n = int(input())
count = 0
while n:
	wrd = input().lower()
	if wrd == 'tetrahedron':
		s = 4
	elif wrd == 'cube':
		s = 6
	elif wrd == 'octahedron':
		s = 8
	elif wrd == 'dodecahedron':
		s = 12
	elif wrd == 'icosahedron':
		s = 20
	count += s
	n -= 1
print(count)


n = int(input())
aDict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
m = 0
for i in range(n):
	b = input()
	m += aDict[b]
print(m)


n = int(input())
p = 0
for i in range(n):
	k = input()
	if k == 'Tetrahedron':
		p += 4
	if k == 'Cube':
		p += 6
	if k == 'Octahedron':
		p += 8
	if k == 'Dodecahedron':
		p += 12
	if k == 'Icosahedron':
		p += 20
print(p)


n = int(input())
list = []
sum = 0
for _ in range(n):
	s = str(input())
	list.append(s)
for i in range(len(list)):
	if list[i] == 'Tetrahedron':
		sum += 4
	if list[i] == 'Cube':
		sum += 6
	if list[i] == 'Octahedron':
		sum += 8
	if list[i] == 'Dodecahedron':
		sum += 12
	if list[i] == 'Icosahedron':
		sum += 20
print(sum)


x = int(input())
sum = 0
for i in range(x):
	s = input()
	if s == 'Tetrahedron':
		sum = sum + 4
	elif s == 'Cube':
		sum = sum + 6
	elif s == 'Octahedron':
		sum = sum + 8
	elif s == 'Dodecahedron':
		sum = sum + 12
	elif s == 'Icosahedron':
		sum = sum + 20
print(sum)


n = int(input())
cnt = 0
for i in range(n):
	entry = input()
	if entry == 'Tetrahedron':
		cnt += 4
	elif entry == 'Cube':
		cnt += 6
	elif entry == 'Octahedron':
		cnt += 8
	elif entry == 'Dodecahedron':
		cnt += 12
	elif entry == 'Icosahedron':
		cnt += 20
print(cnt)


poly = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
numbers = int(input())
count = 0
for number in range(numbers):
	sampleInput = input()
	count += poly[sampleInput]
print(count)


x = [input() for i in range(int(input()))]
f = 0
for j in x:
	if j == 'Tetrahedron':
		f += 4
	if j == 'Cube':
		f += 6
	if j == 'Octahedron':
		f += 8
	if j == 'Dodecahedron':
		f += 12
	if j == 'Icosahedron':
		f += 20
print(f)


d = {'Icosahedron': 20, 'Cube': 6, 'Tetrahedron': 4, 'Dodecahedron': 12, 'Octahedron': 8}
(n, ans) = (int(input()), 0)
while n:
	ans += d[input()]
	n -= 1
print(ans)


poly = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
res = 0
for _ in range(n):
	p = input()
	res += poly[p]
print(res)


def get_number_of_sides(polyhedron):
	if polyhedron == 'Tetrahedron':
		return 4
	elif polyhedron == 'Cube':
		return 6
	elif polyhedron == 'Octahedron':
		return 8
	elif polyhedron == 'Dodecahedron':
		return 12
	else:
		return 20
number_of_sides = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
facets = 0
i = 0
while i < n:
	facets += number_of_sides[input()]
	i += 1
print(facets)


n = int(input())
cnt = 0
for i in range(n):
	shape = input()
	if shape[0] == 'T':
		cnt += 4
	elif shape[0] == 'C':
		cnt += 6
	elif shape[0] == 'O':
		cnt += 8
	elif shape[0] == 'D':
		cnt += 12
	elif shape[0] == 'I':
		cnt += 20
print(cnt)


p_in = int(input())
output = 0
for x in range(p_in):
	s_in = input()
	if s_in[0] == 'T':
		output += 4
	if s_in[0] == 'C':
		output += 6
	if s_in[0] == 'O':
		output += 8
	if s_in[0] == 'D':
		output += 12
	if s_in[0] == 'I':
		output += 20
print(output)


a = []
for i in range(int(input())):
	a.append(input())
print(4 * a.count('Tetrahedron') + 6 * a.count('Cube') + 8 * a.count('Octahedron') + 12 * a.count('Dodecahedron') + 20 * a.count('Icosahedron'))


from sys import *
res = 0
d = dict()
d['C'] = 6
d['O'] = 8
d['T'] = 4
d['D'] = 12
d['I'] = 20
n = int(input())
for i in range(n):
	s = input()
	res += d[s[0]]
print(res)


n = int(input())
output = 0
while n > 0:
	n -= 1
	polyherdrons = list(input().split(' '))
	if 'Tetrahedron' in polyherdrons:
		output += 4
	elif 'Cube' in polyherdrons:
		output += 6
	elif 'Octahedron' in polyherdrons:
		output += 8
	elif 'Dodecahedron' in polyherdrons:
		output += 12
	elif 'Icosahedron' in polyherdrons:
		output += 20
print(output)


diction = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
sumi = 0
for i in range(n):
	sumi += diction[input()]
print(sumi)


t = int(input())
li = []
dic = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(t):
	n = input()
	li.append(n)
sum = 0
for x in li:
	sum += dic[x]
print(sum)


h = {'Cube': 6, 'Tetrahedron': 4, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
t = int(input())
tt = 0
for _ in range(t):
	s = input()
	tt += h[s]
print(tt)


i = input()
s1 = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
s2 = [4, 6, 8, 12, 20]
s3 = []
for x in range(0, int(i)):
	inp = input()
	l = s1.index(inp)
	s3.append(s2[l])
print(sum(s3))


n = int(input())
hasil = 0
for i in range(n):
	bentuk = input()
	if bentuk == 'Tetrahedron':
		face = 4
	elif bentuk == 'Cube':
		face = 6
	elif bentuk == 'Octahedron':
		face = 8
	elif bentuk == 'Dodecahedron':
		face = 12
	elif bentuk == 'Icosahedron':
		face = 20
	hasil += face
print(hasil)


a = int(input())
j = []
for e in range(a):
	j.append(input())
k = 0
for e in j:
	if e[0] == 'T':
		k += 4
	if e[0] == 'C':
		k += 6
	if e[0] == 'O':
		k += 8
	if e[0] == 'D':
		k += 12
	if e[0] == 'I':
		k += 20
print(k)


pol = [['Tetrahedron', 4], ['Cube', 6], ['Octahedron', 8], ['Dodecahedron', 12], ['Icosahedron', 20]]
m = [0] * 256
for p in pol:
	m[ord(p[0][0])] = p[1]
N = int(input())
tot = 0
for _ in range(N):
	p = input()
	tot += m[ord(p[0])]
print(tot)


faces = {'Cube': 6, 'Tetrahedron': 4, 'Dodecahedron': 12, 'Octahedron': 8, 'Icosahedron': 20}
n = int(input())
d = []
for i in range(n):
	name = str(input())
	for j in faces.keys():
		if name == j:
			d.append(faces[j])
print(sum(d))


side = int(input())
count = 0
for i in range(side):
	poly = input()
	if poly == 'Tetrahedron':
		count = count + 4
	elif poly == 'Cube':
		count = count + 6
	elif poly == 'Octahedron':
		count = count + 8
	elif poly == 'Dodecahedron':
		count = count + 12
	elif poly == 'Icosahedron':
		count = count + 20
print(count)


polyderons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
total = 0
for x in range(n):
	poly = input()
	total = total + polyderons[poly]
print(total)


n = int(input())
result = 0
poly = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
while n > 0:
	result += poly[input()]
	n -= 1
print(result)


n = eval(input())
l = []
for i in range(n):
	x = input()
	if x == 'Tetrahedron':
		l.append(4)
	elif x == 'Cube':
		l.append(6)
	elif x == 'Octahedron':
		l.append(8)
	elif x == 'Dodecahedron':
		l.append(12)
	else:
		l.append(20)
print(sum(l))


n = int(input())
total = 0
faces = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
while n > 0:
	total += faces[input()]
	n -= 1
print(total)


catalog = dict(Tetrahedron=4, Cube=6, Octahedron=8, Dodecahedron=12, Icosahedron=20)
res = 0
n = int(input())
for i in range(n):
	name = input()
	res += catalog[name]
print(res)


data = int(input())
types = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
result = 0
for i in range(data):
	line = input()
	result += types[line]
print(result)


n = int(input())
k = 0
for i in range(n):
	x = input()
	if x[0] == 'T':
		k += 4
	if x[0] == 'C':
		k += 6
	if x[0] == 'O':
		k += 8
	if x[0] == 'D':
		k += 12
	if x[0] == 'I':
		k += 20
print(k)


n = int(input())
x = [None] * n
while n > 0:
	x[n - 1] = input()
	n -= 1
l = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
a = [None] * 5
i = 0
for item in l:
	a[i] = x.count(item)
	i += 1
print(a[0] * 4 + a[1] * 6 + a[2] * 8 + a[3] * 12 + a[4] * 20)


n = int(input())
s = []
p = []
for i in range(n):
	s.append(input())
for i in range(len(s)):
	if s[i] == 'Icosahedron':
		p.append(20)
	if s[i] == 'Tetrahedron':
		p.append(4)
	if s[i] == 'Cube':
		p.append(6)
	if s[i] == 'Octahedron':
		p.append(8)
	if s[i] == 'Dodecahedron':
		p.append(12)
print(sum(p), end='')


t = int(input())
l = {'Icosahedron': 20, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Tetrahedron': 4}
c = 0
while t:
	t -= 1
	s = input()
	c += l[s]
print(c)


opt = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input().strip())
sum = 0
for i in range(0, n):
	geo = input().strip()
	if opt.get(geo):
		sum += opt[geo]
print(sum)


import sys
n = int(sys.stdin.readline())
a = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
result = 0
for i in range(n):
	result += a[sys.stdin.readline()[:-1]]
print(result)


A = int(input())
Resultado = 0
for i in range(A):
	Figura = input()
	if Figura == 'Tetrahedron':
		Resultado += 4
	elif Figura == 'Cube':
		Resultado += 6
	elif Figura == 'Octahedron':
		Resultado += 8
	elif Figura == 'Dodecahedron':
		Resultado += 12
	else:
		Resultado += 20
print(Resultado)


ans = 0
for _ in range(int(input())):
	a = input()
	if a == 'Tetrahedron':
		ans += 4
	elif a == 'Cube':
		ans += 6
	elif a == 'Octahedron':
		ans += 8
	elif a == 'Dodecahedron':
		ans += 12
	else:
		ans += 20
print(ans)


l = []
q = []
dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
sum = 0
for i in range(int(input())):
	q = input()
	l.append(q)
for (x, y) in dict.items():
	for k in l:
		if x in k:
			sum = sum + y
print(sum)


n = int(input())
i = 1
s = 0
while i <= n:
	g = input()
	if g == 'Tetrahedron':
		s += 4
	if g == 'Cube':
		s += 6
	if g == 'Octahedron':
		s += 8
	if g == 'Dodecahedron':
		s += 12
	if g == 'Icosahedron':
		s += 20
	i += 1
print(s)


n = int(input())
shape_num_li = []
while n > 0:
	shape_num = input()
	shape_num_li.append(shape_num)
	n -= 1
a = int(shape_num_li.count('Cube')) * 6
b = int(shape_num_li.count('Tetrahedron')) * 4
c = int(shape_num_li.count('Octahedron')) * 8
d = int(shape_num_li.count('Dodecahedron')) * 12
e = int(shape_num_li.count('Icosahedron')) * 20
print(a + b + c + d + e)


polys = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
total = 0
for i in range(n):
	shape = input().strip()
	total += polys[shape]
print(str(total))


polygons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
summ = 0
for _ in range(n):
	summ += polygons[input()]
print(summ)


n = int(input())
count = 0
dict1 = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(n):
	a = input()
	count += dict1[a]
print(count)


x = int(input())
somme = 0
dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(x):
	ch = str(input())
	somme += dict.get(ch)
print(somme)


n = int(input())
l = []
for r in range(0, n):
	l.append(input())
s = 0
for m in l:
	if m == 'Tetrahedron':
		s += 4
	elif m == 'Cube':
		s += 6
	elif m == 'Octahedron':
		s += 8
	elif m == 'Dodecahedron':
		s += 12
	elif m == 'Icosahedron':
		s += 20
print(s)


a = int(input())
b = list([])
for i in range(a):
	c = input()
	if c == 'Icosahedron':
		b.append(20)
	elif c == 'Dodecahedron':
		b.append(12)
	elif c == 'Octahedron':
		b.append(8)
	elif c == 'Cube':
		b.append(6)
	elif c == 'Tetrahedron':
		b.append(4)
	else:
		continue
d = sum(b)
print(d)


data = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
ans = 0
for _ in range(0, n):
	s = input()
	ans = ans + data[s]
print(ans)


class Solver:

	def run(self):
		n = int(input())
		d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
		print(sum((d[input()] for _ in range(0, n))))
Solver().run()


x = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
count = 0
l = []
for i in range(n):
	l.append(input())
for i in l:
	count += x[i]
print(count)


number_of_geometry = int(input())
cnt_sides = 0
for i in range(number_of_geometry):
	name = input()
	if name == 'Tetrahedron':
		cnt_sides += 4
	elif name == 'Cube':
		cnt_sides += 6
	elif name == 'Octahedron':
		cnt_sides += 8
	elif name == 'Dodecahedron':
		cnt_sides += 12
	else:
		cnt_sides += 20
print(cnt_sides)


n = int(input())
p = []
for i in range(n):
	figuras = str(input())
	p.append(figuras)
x = 0
for j in p:
	if j == 'Tetrahedron':
		x = x + 4
	elif j == 'Cube':
		x = x + 6
	elif j == 'Octahedron':
		x = x + 8
	elif j == 'Dodecahedron':
		x = x + 12
	elif j == 'Icosahedron':
		x = x + 20
print(x)


import sys
figures = dict(Tetrahedron=4, Cube=6, Octahedron=8, Dodecahedron=12, Icosahedron=20)
count = 0
for _ in range(int(sys.stdin.readline())):
	count += figures[sys.stdin.readline().strip()]
print(count)


n = int(input())
arr = []
for i in range(n):
	string = input()
	arr.append(string)
sum = 0
for i in arr:
	if i == 'Tetrahedron':
		sum += 4
	elif i == 'Cube':
		sum += 6
	elif i == 'Octahedron':
		sum += 8
	elif i == 'Dodecahedron':
		sum += 12
	elif i == 'Icosahedron':
		sum += 20
print(sum)


n = int(input())
figures = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
result = 0
while n > 0:
	figure = str(input())
	if figure in figures:
		result += figures[figure]
	n -= 1
print(result)


plyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
polyhedrons_count = int(input())
faces_count = 0
for position in range(0, polyhedrons_count):
	name = input()
	faces_count += plyhedrons[name]
print(faces_count)


four = 'Tetrahedron'
six = 'Cube'
eight = 'Octahedron'
twelve = 'Dodecahedron'
twenty = 'Icosahedron'
x = int(input())
shapes = []
for prompt in range(x):
	shape = input()
	shapes.append(shape)
count = 0
for shape in shapes:
	if shape == four:
		count = count + 4
	elif shape == six:
		count = count + 6
	elif shape == eight:
		count = count + 8
	elif shape == twelve:
		count = count + 12
	elif shape == twenty:
		count = count + 20
print(count)


total_sides = 0
shapes = {'Icosahedron': 20, 'Cube': 6, 'Tetrahedron': 4, 'Dodecahedron': 12, 'Octahedron': 8}
no_of_items = int(input())
l1st_of_items = []
for i in range(no_of_items):
	nxt = input()
	total_sides = total_sides + shapes[nxt]
	l1st_of_items.append(nxt)
print(total_sides)


totalfaces = 0
for i in range(0, int(input())):
	string = input()
	if string == 'Tetrahedron':
		totalfaces += 4
	elif string == 'Cube':
		totalfaces += 6
	elif string == 'Octahedron':
		totalfaces += 8
	elif string == 'Dodecahedron':
		totalfaces += 12
	elif string == 'Icosahedron':
		totalfaces += 20
print(totalfaces)


t = int(input())
count = 0
while t:
	str = input()
	if str == 'Icosahedron':
		count += 20
	elif str == 'Cube':
		count += 6
	elif str == 'Tetrahedron':
		count += 4
	elif str == 'Octahedron':
		count += 8
	else:
		count += 12
	t = t - 1
print(count)


num = int(input())
types = [str(input()) for i in range(num)]
count = 0
for Type in types:
	if Type == 'Tetrahedron':
		count += 4
	elif Type == 'Cube':
		count += 6
	elif Type == 'Octahedron':
		count += 8
	elif Type == 'Dodecahedron':
		count += 12
	elif Type == 'Icosahedron':
		count += 20
print(count)


shapes = int(input())
my_dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
counter = 0
faces = 0
while counter < shapes:
	shape = input()
	faces = faces + my_dict[shape]
	counter = counter + 1
print(faces)


ans = 0
for _ in range(int(input())):
	s = input()
	if s[0] == 'I':
		ans += 20
	elif s[0] == 'D':
		ans += 12
	elif s[0] == 'O':
		ans += 8
	elif s[0] == 'C':
		ans += 6
	else:
		ans += 4
print(ans)


t = int(input())
f = 0
while t > 0:
	x = input()
	if x[0] == 'T':
		f += 4
	elif x[0] == 'C':
		f += 6
	elif x[0] == 'D':
		f += 12
	elif x[0] == 'O':
		f += 8
	elif x[0] == 'I':
		f += 20
	t -= 1
print(f)


n = int(input())
t = 4
c = 6
o = 8
d = 12
i = 20
ans = 0
for x in range(0, n):
	s = str(input())
	if s == 'Tetrahedron':
		ans += t
	if s == 'Cube':
		ans += c
	if s == 'Octahedron':
		ans += o
	if s == 'Dodecahedron':
		ans += d
	if s == 'Icosahedron':
		ans += i
print(ans)


n = int(input())
shapes = ('Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron')
faces = (4, 6, 8, 12, 20)
ans = 0
for _ in range(n):
	s = input()
	i = shapes.index(s)
	ans += faces[i]
print(ans)


n = int(input())
count = 0
for i in range(n):
	s = input()
	if s[0] == 'I':
		count += 20
	elif s[0] == 'T':
		count += 4
	elif s[0] == 'C':
		count += 6
	elif s[0] == 'O':
		count += 8
	else:
		count += 12
print(count)


n = int(input())
l = []
s = 0
k = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
v = [4, 6, 8, 12, 20]
d = dict(zip(k, v))
for _ in range(n):
	s += d[input()]
print(s)


n = int(input())
letters = []
shape = ''
cnt = 0
for i in range(n):
	shape = list(input())
	letters.append(shape[0])
for j in letters:
	if j == 'T':
		cnt += 4
	if j == 'C':
		cnt += 6
	if j == 'I':
		cnt += 20
	if j == 'D':
		cnt += 12
	if j == 'O':
		cnt += 8
print(cnt)


x = input()
sum = 0
for _ in range(int(x)):
	t = input()
	if t[0] == 'T':
		sum += 4
	elif t[0] == 'C':
		sum += 6
	elif t[0] == 'O':
		sum += 8
	elif t[0] == 'D':
		sum += 12
	elif t[0] == 'I':
		sum += 20
print(sum)


masukan = int(input())
tempat = []
for i in range(masukan):
	tempat += input().split()
tambah = 0
for a in range(len(tempat)):
	if tempat[a] == 'Tetrahedron':
		tambah += 4
	if tempat[a] == 'Cube':
		tambah += 6
	if tempat[a] == 'Octahedron':
		tambah += 8
	if tempat[a] == 'Dodecahedron':
		tambah += 12
	if tempat[a] == 'Icosahedron':
		tambah += 20
print(tambah)


n = int(input())
count = 0
while n != 0:
	n -= 1
	s = str(input())
	if s[0] == 'T':
		count += 4
	elif s[0] == 'I':
		count += 20
	elif s[0] == 'D':
		count += 12
	elif s[0] == 'O':
		count += 8
	else:
		count += 6
print(count)


a = int(input())
sum = 0
for k in range(a):
	b = input()
	if b == 'Tetrahedron':
		sum += 4
	elif b == 'Cube':
		sum += 6
	elif b == 'Octahedron':
		sum += 8
	elif b == 'Dodecahedron':
		sum += 12
	else:
		sum += 20
print(sum)


def faces(a):
	h = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	res = 0
	for i in a:
		res += h[i]
	print(res)
a = []
for i in range(int(input())):
	a.append(input())
faces(a)


def polyhedrons(lst):
	total = 0
	my_dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	for i in lst:
		total += my_dict[i]
	return total
n = int(input())
lst = []
for i in range(n):
	lst.append(str(input()))
res = polyhedrons(lst)
print(res)


n = int(input())
dict = {}
dict['Tetrahedron'] = 4
dict['Cube'] = 6
dict['Octahedron'] = 8
dict['Dodecahedron'] = 12
dict['Icosahedron'] = 20
total = 0
for _ in range(n):
	s = input()
	if s in dict:
		total += dict[s]
print(total)


n = int(input())
k = 0
b = []
for _ in range(n):
	b.append(input())
for i in b:
	if i == 'Tetrahedron':
		k = k + 4
	if i == 'Cube':
		k = k + 6
	if i == 'Octahedron':
		k = k + 8
	if i == 'Dodecahedron':
		k = k + 12
	if i == 'Icosahedron':
		k = k + 20
print(k)


def main(n):
	a = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	return a[n]
n = int(input().strip(' '))
faces = 0
for i in range(n):
	faces += main(input().strip(' '))
print(faces)


(n, a, k) = (int(input()), '', 0)
cub = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
cubn = [4, 6, 8, 12, 20]
for i in range(n):
	a = input()
	for j in range(5):
		if cub[j] == a:
			k += cubn[j]
print(k)


index = int(input())
result = 0
while index > 0:
	thing = input()
	if thing == 'Tetrahedron':
		a = 4
	elif thing == 'Cube':
		a = 6
	elif thing == 'Octahedron':
		a = 8
	elif thing == 'Dodecahedron':
		a = 12
	elif thing == 'Icosahedron':
		a = 20
	result = result + a
	index = index - 1
print(result)


T = int(input())
jumlah = 0
for i in range(T):
	kata = input()
	if kata == 'Tetrahedron':
		jumlah += 4
	elif kata == 'Cube':
		jumlah += 6
	elif kata == 'Octahedron':
		jumlah += 8
	elif kata == 'Dodecahedron':
		jumlah += 12
	elif kata == 'Icosahedron':
		jumlah += 20
print(jumlah)


dicts = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
sumFaces = 0
for i in range(n):
	plyhedron = input()
	sumFaces += dicts[plyhedron]
print(sumFaces)


faces = 0
x = int(input())
while x > 0:
	obj = input()
	if obj == 'Tetrahedron':
		faces += 4
	elif obj == 'Cube':
		faces += 6
	elif obj == 'Octahedron':
		faces += 8
	elif obj == 'Dodecahedron':
		faces += 12
	elif obj == 'Icosahedron':
		faces += 20
	x -= 1
print(faces)


from sys import stdin
a = stdin.readline().split()
q = int(a[0])
count = 0
for b in range(0, q):
	c = stdin.readline().split()
	if c[0] == 'Tetrahedron':
		count += 4
	elif c[0] == 'Cube':
		count += 6
	elif c[0] == 'Octahedron':
		count += 8
	elif c[0] == 'Dodecahedron':
		count += 12
	elif c[0] == 'Icosahedron':
		count += 20
print(count)


from sys import stdin, stdout
arr = [x.strip('\n') for x in stdin.readlines()]
dt = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
stdout.write(str(sum([dt[p] for p in arr if p in dt])))


n = int(input())
l = [input() for i in range(n)]
k = 0
dic = dict(zip(['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron'], [4, 6, 8, 12, 20]))
for i in l:
	if i in dic.keys():
		k += dic.get(i)
print(k)


face_dic = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
sum = 0
for i in range(n):
	type_s = input()
	ts = face_dic[type_s]
	sum += ts
print(sum)


def main():
	n_polyhedrons = int(input())
	total_faces = 0
	faces = {'cube': 6, 'tetrahedron': 4, 'octahedron': 8, 'dodecahedron': 12, 'icosahedron': 20}
	for i in range(n_polyhedrons):
		total_faces += faces[input().lower()]
	print(total_faces)
main()


def check(f):
	if f == 'T':
		return 4
	elif f == 'C':
		return 6
	elif f == 'O':
		return 8
	elif f == 'D':
		return 12
	else:
		return 20
n = int(input())
r = 0
for i in range(n):
	f = input()[0]
	r += check(f)
print(r)


count = int(input())
total_sides = 0
for i in range(count):
	shape = input()
	if shape[0] == 'T':
		total_sides += 4
	elif shape[0] == 'C':
		total_sides += 6
	elif shape[0] == 'O':
		total_sides += 8
	elif shape[0] == 'D':
		total_sides += 12
	elif shape[0] == 'I':
		total_sides += 20
print(total_sides)


n = int(input())
numbers = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
count = 0
for x in range(n):
	count += numbers[input()]
print(count)


num = int(input())
i = 0
y = 0
for i in range(0, num):
	i += 1
	x = input()
	if x == 'Tetrahedron':
		y += 4
	elif x == 'Cube':
		y += 6
	elif x == 'Octahedron':
		y += 8
	elif x == 'Dodecahedron':
		y += 12
	elif x == 'Icosahedron':
		y += 20
print(y)


x = int(input())
ls = []
for i in range(x):
	j = input()
	ls.append(j)
runningsum = 0
for i in ls:
	if i == 'Tetrahedron':
		runningsum += 4
	if i == 'Cube':
		runningsum += 6
	if i == 'Octahedron':
		runningsum += 8
	if i == 'Dodecahedron':
		runningsum += 12
	if i == 'Icosahedron':
		runningsum += 20
print(runningsum)


n = int(input())
l = list()
try:
	while True:
		x = input()
		if len(x) > 0:
			l.append(x)
		else:
			break
except EOFError:
	pass
summ = 0
for i in l:
	if i == 'Tetrahedron':
		summ += 4
	elif i == 'Cube':
		summ += 6
	elif i == 'Octahedron':
		summ += 8
	elif i == 'Dodecahedron':
		summ += 12
	else:
		summ += 20
print(summ)


n = int(input())
a = []
for i in range(n):
	y = str(input())
	a.append(y)
sum = 0
for i in range(n):
	if a[i] == 'Icosahedron':
		sum = sum + 20
	elif a[i] == 'Dodecahedron':
		sum = sum + 12
	elif a[i] == 'Octahedron':
		sum = sum + 8
	elif a[i] == 'Cube':
		sum = sum + 6
	elif a[i] == 'Tetrahedron':
		sum = sum + 4
print(sum)


q = int(input())
fig_faces = dict(Icosahedron=20, Cube=6, Tetrahedron=4, Dodecahedron=12, Octahedron=8)
figlist = []
for _ in range(q):
	figlist.append(fig_faces[input()])
print(sum(figlist))


n = int(input())
otv = 0
for i in range(n):
	st = input()
	if st == 'Tetrahedron':
		otv += 4
	if st == 'Cube':
		otv += 6
	if st == 'Octahedron':
		otv += 8
	if st == 'Dodecahedron':
		otv += 12
	if st == 'Icosahedron':
		otv += 20
print(otv)


num = int(input())
total = 0
faces = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(num):
	total += faces[str(input())]
print(total)


import math
n = input()
contador = 0
cadena = ''
for x in range(int(n)):
	cadena = input()
	if cadena == 'Tetrahedron':
		contador = contador + 4
	if cadena == 'Cube':
		contador = contador + 6
	if cadena == 'Octahedron':
		contador = contador + 8
	if cadena == 'Dodecahedron':
		contador = contador + 12
	if cadena == 'Icosahedron':
		contador = contador + 20
contador = int(contador)
print(contador)


n = int(input())
l = []
for i in range(n):
	t = input()
	l.append(t)
di = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
s = 0
for i in l:
	s += di[i]
print(s)


n = input()
n = int(n)
a = []
face = 0
for i in range(n):
	b = input()
	a.append(b)
for i in range(n):
	if a[i] == 'Tetrahedron':
		face = face + 4
	if a[i] == 'Cube':
		face = face + 6
	if a[i] == 'Octahedron':
		face = face + 8
	if a[i] == 'Dodecahedron':
		face = face + 12
	if a[i] == 'Icosahedron':
		face = face + 20
print(face)


count = int(input())
result = 0
for i in range(0, count):
	name = input()
	if name == 'Icosahedron':
		result += 20
	elif name == 'Dodecahedron':
		result += 12
	elif name == 'Octahedron':
		result += 8
	elif name == 'Cube':
		result += 6
	elif name == 'Tetrahedron':
		result += 4
print(result)


n = int(input())
n_f = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
f = 0
for _ in range(n):
	f += n_f[input()[0]]
print(f)


def findSides(shapesL):
	shapes = {}
	shapes['Tetrahedron'] = 4
	shapes['Cube'] = 6
	shapes['Octahedron'] = 8
	shapes['Dodecahedron'] = 12
	shapes['Icosahedron'] = 20
	faces = 0
	for shape in shapesL:
		faces += shapes[str(shape)]
	return faces
nums = input()
shapes = []
for i in range(int(nums)):
	shape = str(input())
	shapes.append(str(shape))
print(findSides(shapes))


n = int(input())
li = []
k = 0
for i in range(n):
	a = input()
	li.append(a)
for i in li:
	if i == 'Tetrahedron':
		k = k + 4
	elif i == 'Cube':
		k = k + 6
	elif i == 'Octahedron':
		k = k + 8
	elif i == 'Dodecahedron':
		k = k + 12
	elif i == 'Icosahedron':
		k = k + 20
	else:
		print('Invalid Input')
print(k)


n = int(input())
S = 0
for i in range(n):
	l = input().split('e')
	if l[0][0] == 'I':
		S += 20
	if l[0][0] == 'C':
		S += 6
	if l[0][0] == 'O':
		S += 8
	if l[0][0] == 'D':
		S += 12
	if l[0][0] == 'T':
		S += 4
print(S)


def main():
	n = int(input())
	d = {'Icosahedron': 20, 'Cube': 6, 'Tetrahedron': 4, 'Dodecahedron': 12, 'Octahedron': 8}
	total = 0
	for i in range(n):
		poly = str(input().strip())
		total += d[poly]
	print(total)
main()


m = {'I': 20, 'D': 12, 'O': 8, 'C': 6, 'T': 4}
n = int(input())
ans = 0
for i in range(n):
	ans += m[input()[0]]
print(ans)


def f(lst):
	dict_count = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	count = 0
	for i in lst:
		count += dict_count[i]
	return count
number = int(input())
lst = []
for i in range(number):
	add = input()
	lst.append(add)
print(f(lst))


num = int(input())
ans = 0
for i in range(num):
	s = input()
	if s == 'Tetrahedron':
		ans += 4
	if s == 'Cube':
		ans += 6
	if s == 'Octahedron':
		ans += 8
	if s == 'Dodecahedron':
		ans += 12
	if s == 'Icosahedron':
		ans += 20
print(ans)


n = int(input())
sum = 0
while n != 0:
	s = input()
	if s == 'Icosahedron':
		sum += 20
	elif s == 'Cube':
		sum += 6
	elif s == 'Octahedron':
		sum += 8
	elif s == 'Tetrahedron':
		sum += 4
	else:
		sum += 12
	n -= 1
print(sum)


import math
n = int(input())
a = []
for i in range(n):
	a.append(input())
m = a.count('Icosahedron')
n = a.count('Cube')
o = a.count('Tetrahedron')
p = a.count('Dodecahedron')
q = a.count('Octahedron')
print(m * 20 + n * 6 + o * 4 + p * 12 + q * 8)


def countFaces(arr):
	cnt = 0
	for ele in arr:
		if ele == 'Icosahedron':
			cnt += 20
		elif ele == 'Cube':
			cnt += 6
		elif ele == 'Octahedron':
			cnt += 8
		elif ele == 'Dodecahedron':
			cnt += 12
		else:
			cnt += 4
	return cnt
n = int(input())
arr = [''] * n
for i in range(n):
	arr[i] = input()
print(countFaces(arr))


n = int(input())
lst = []
for i in range(n):
	t = input()
	lst.append(t)
res = 0
for i in range(n):
	if lst[i] == 'Tetrahedron':
		res += 4
	elif lst[i] == 'Cube':
		res += 6
	elif lst[i] == 'Icosahedron':
		res += 20
	elif lst[i] == 'Octahedron':
		res += 8
	elif lst[i] == 'Dodecahedron':
		res += 12
print(res)


n = int(input())
l = []
f = 0
for i in range(n):
	s = input()
	s = s.lower()
	l.append(s)
for i in l:
	if i == 'tetrahedron':
		f = f + 4
	if i == 'cube':
		f = f + 6
	if i == 'octahedron':
		f = f + 8
	if i == 'dodecahedron':
		f = f + 12
	if i == 'icosahedron':
		f = f + 20
print(f)


h = int(input())
i = 0
d = 0
while i < h:
	a = input()
	if a == 'Tetrahedron':
		d += 4
	if a == 'Cube':
		d += 6
	if a == 'Octahedron':
		d += 8
	if a == 'Dodecahedron':
		d += 12
	if a == 'Icosahedron':
		d += 20
	i += 1
print(d)


def main():
	a = int(input())
	out = 0
	for _ in range(a):
		b = input()
		if b == 'Tetrahedron':
			out += 4
		elif b == 'Cube':
			out += 6
		elif b == 'Octahedron':
			out += 8
		elif b == 'Dodecahedron':
			out += 12
		elif b == 'Icosahedron':
			out += 20
		else:
			out += 0
	print(out)
main()


n = int(input())
count = 0
for i in range(n):
	s = input()
	if s == 'Icosahedron':
		count = count + 20
	elif s == 'Cube':
		count = count + 6
	elif s == 'Tetrahedron':
		count = count + 4
	elif s == 'Dodecahedron':
		count = count + 12
	else:
		count = count + 8
print(count)


n = int(input())
ls = [input()[0] for x in range(n)]
value = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
sum = 0
for val in ls:
	sum += value[val]
print(sum)


t = int(input())
summ = 0
while t > 0:
	t -= 1
	d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	n = input()
	summ += d.get(n, 0)
print(summ)


n = int(input())
i = 0
count = 0
while i < n:
	z = input()
	if z == 'Tetrahedron':
		count += 4
	elif z == 'Cube':
		count += 6
	elif z == 'Octahedron':
		count += 8
	elif z == 'Dodecahedron':
		count += 12
	elif z == 'Icosahedron':
		count += 20
	i += 1
print(count)


t = int(input())
p = 0
q = 0
r = 0
w = 0
x = 0
for i in range(t):
	s = input()
	if s == 'Tetrahedron':
		p = p + 4
	elif s == 'Cube':
		q = q + 6
	elif s == 'Octahedron':
		r = r + 8
	elif s == 'Dodecahedron':
		x = x + 12
	elif s == 'Icosahedron':
		w = w + 20
z = p + q + r + x + w
print(z)


n = int(input())
summa = 0
for i in range(0, n):
	s = str(input())
	if s == 'Tetrahedron':
		summa = summa + 4
	if s == 'Cube':
		summa = summa + 6
	if s == 'Octahedron':
		summa = summa + 8
	if s == 'Dodecahedron':
		summa = summa + 12
	if s == 'Icosahedron':
		summa = summa + 20
print(summa)


d = dict()
d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
res = 0
for i in range(n):
	ch = input()
	res = res + d[ch]
print(res)


(my_list, j, k) = (['T', 4, 'C', 6, 'O', 8, 'D', 12, 'I', 20], 0, 0)
for i in range(int(input())):
	j = my_list.index(input()[0])
	k += my_list[j + 1]
print(k)


n = int(input())
l1 = []
c = 0
d1 = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(0, n):
	s = input()
	l1.append(s)
for j in l1:
	c += d1[j]
print(c)


t = int(input())
count = 0
for i in range(t):
	s = input()
	if s == 'Tetrahedron':
		count += 4
	if s == 'Cube':
		count += 6
	if s == 'Octahedron':
		count += 8
	if s == 'Dodecahedron':
		count += 12
	if s == 'Icosahedron':
		count += 20
print(count)


n = int(input())
ph = []
for i in range(n):
	ph.append(input())
th = ph.count('Tetrahedron')
cu = ph.count('Cube')
oh = ph.count('Octahedron')
ddh = ph.count('Dodecahedron')
ih = ph.count('Icosahedron')
print(4 * th + 6 * cu + 8 * oh + 12 * ddh + 20 * ih)


(n, counter) = (int(input()), 0)
for i in range(n):
	buff = input()
	if buff == 'Tetrahedron':
		counter += 4
	elif buff == 'Cube':
		counter += 6
	elif buff == 'Octahedron':
		counter += 8
	elif buff == 'Dodecahedron':
		counter += 12
	elif buff == 'Icosahedron':
		counter += 20
print(counter)


import math
a = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
b = int(input())
c = 0
for i in range(b):
	c += a[input()]
print(c)


import sys
(faces, polyhedron_faces) = (0, {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20})
print(sum((polyhedron_faces[x.strip()] for x in list(sys.stdin)[1:])))


v = int(input())
b = 0
for i in range(v):
	figura = input()
	if figura == 'Cube':
		b = b + 6
	if figura == 'Tetrahedron':
		b = b + 4
	if figura == 'Octahedron':
		b = b + 8
	if figura == 'Dodecahedron':
		b = b + 12
	if figura == 'Icosahedron':
		b = b + 20
print(b)


def main():
	dict1 = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	n = int(input())
	sum1 = 0
	for i in range(n):
		s = input()
		sum1 += dict1[s]
	print(sum1)
main()


d = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
n = int(input())
c = 0
for k in range(n):
	a = input()
	c += d[a[0]]
print(c)


import sys
con = 0
for t in range(int(input())):
	sa = str(input())
	if sa[0] == 'T':
		con += 4
	elif sa[0] == 'C':
		con += 6
	elif sa[0] == 'O':
		con += 8
	elif sa[0] == 'D':
		con += 12
	else:
		con += 20
print(con)


def Main():
	n = int(input())
	res = 0
	for _ in range(n):
		s = input()
		if s == 'Tetrahedron':
			res += 4
		elif s == 'Cube':
			res += 6
		elif s == 'Octahedron':
			res += 8
		elif s == 'Dodecahedron':
			res += 12
		elif s == 'Icosahedron':
			res += 20
	print(res)
Main()


n = int(input())
sum = 0
for i in range(n):
	b = input()
	if b[0] == 'T':
		sum += 4
	elif b[0] == 'C':
		sum += 6
	elif b[0] == 'I':
		sum += 20
	elif b[0] == 'O':
		sum += 8
	else:
		sum += 12
print(sum)


d = {}
(d['Tetrahedron'], d['Cube'], d['Octahedron'], d['Dodecahedron'], d['Icosahedron']) = (4, 6, 8, 12, 20)
c = 0
for _ in range(int(input())):
	c += d[input().strip()]
print(c)


x = int(input())
L = [input() for i in range(x)]
D = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
count = 0
for i in range(x):
	count += D[L[i]]
print(count)


n = int(input())
result = 0
for i in range(n):
	f = input()[0]
	if f == 'T':
		result += 4
	elif f == 'C':
		result += 6
	elif f == 'O':
		result += 8
	elif f == 'D':
		result += 12
	else:
		result += 20
print(result)


def polyhedrons():
	vals = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	n = int(input())
	total = 0
	for i in range(n):
		total += vals[input()]
	print(total)
polyhedrons()


name_faces = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
count = input()
strings = []
sum = 0
for string in range(0, int(count)):
	strings.append(input())
for string in strings:
	sum += name_faces[string]
print(sum)


n = int(input())
x = []
a = 0
b = 0
c = 0
d = 0
e = 0
for i in range(n):
	new = input()
	x.append(new)
	if x[i] == 'Tetrahedron':
		a += 1
	if x[i] == 'Cube':
		b += 1
	if x[i] == 'Octahedron':
		c += 1
	if x[i] == 'Dodecahedron':
		d += 1
	if x[i] == 'Icosahedron':
		e += 1
f = 4 * a + 6 * b + 8 * c + 12 * d + 20 * e
print(f)


times = int(input())
list1 = []
for i in range(times):
	str1 = input()
	if str1 == 'Tetrahedron':
		list1.append(4)
	elif str1 == 'Cube':
		list1.append(6)
	elif str1 == 'Octahedron':
		list1.append(8)
	elif str1 == 'Dodecahedron':
		list1.append(12)
	else:
		list1.append(20)
print(sum(list1))


t = int(input())
z = 0
for t in range(t):
	p = input()
	if p[0] == 'T':
		z += 4
	elif p[0] == 'C':
		z += 6
	elif p[0] == 'O':
		z += 8
	elif p[0] == 'D':
		z += 12
	else:
		z += 20
print(z)


times = int(input())
shapes = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
sides = 0
for i in range(times):
	shape = input()
	sides += shapes[shape]
print(sides)


polyhedra = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
sumFaces = 0
n = int(input())
for i in range(n):
	polyhedron = input()
	sumFaces += polyhedra.get(polyhedron)
print(sumFaces)


V = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
res = 0
for i in range(n):
	p = input()
	res += V[p]
print(res)


def sideNo(m):
	if m[0] == 'T':
		face = 4
	elif m[0] == 'C':
		face = 6
	elif m[0] == 'O':
		face = 8
	elif m[0] == 'D':
		face = 12
	else:
		face = 20
	return face
n = int(input())
count = 0
for i in range(n):
	s = ''
	s = input()
	count += sideNo(s)
print(count)


a = int(input())
dict1 = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
s = 0
for i in range(0, a):
	l = input()
	s += dict1[l]
print(s)


n = int(input())
c = 0
while n:
	t = input()
	if t == 'Tetrahedron':
		c += 4
	elif t == 'Cube':
		c += 6
	elif t == 'Octahedron':
		c += 8
	elif t == 'Dodecahedron':
		c += 12
	else:
		c += 20
	n -= 1
print(c)


a = dict()
a = {'Tetrahedron': 4, 'Icosahedron': 20, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12}
n = input()
n1 = int(n)
count = 0
while n1:
	x = input()
	count += a[x]
	n1 -= 1
print(count)


no_shapes = int(input())
geoshapes = []
for _ in range(no_shapes):
	geo_shapes = input()
	geoshapes.append(geo_shapes)
total_faces = 0
for shapes in geoshapes:
	if shapes == 'Icosahedron':
		total_faces += 20
	elif shapes == 'Dodecahedron':
		total_faces += 12
	elif shapes == 'Octahedron':
		total_faces += 8
	elif shapes == 'Cube':
		total_faces += 6
	elif shapes == 'Tetrahedron':
		total_faces += 4
print(total_faces)


data_dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
input_list = []
sum = 0
n = int(input())
for i in range(n):
	x = input()
	input_list.append(x)
for polyhedron in input_list:
	if polyhedron in data_dict:
		sum += data_dict[polyhedron]
print(sum)


n = int(input())
nb = 0
d = dict()
d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(n):
	a = str(input())
	nb += d[a]
print(nb)


def main():
	n = int(input())
	mapping = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	ans = 0
	while n > 0:
		inp = input()
		ans += mapping.get(inp)
		n -= 1
	print(ans)
main()


x = int(input())
shapes = []
for prompt in range(x):
	shape = input()
	shapes.append(shape)
count = 0
for shape in shapes:
	if shape == 'Tetrahedron':
		count = count + 4
	elif shape == 'Cube':
		count = count + 6
	elif shape == 'Octahedron':
		count = count + 8
	elif shape == 'Dodecahedron':
		count = count + 12
	elif shape == 'Icosahedron':
		count = count + 20
print(count)


def main():
	n = int(input())
	count = 0
	while n > 0:
		word = input()
		if word == 'Tetrahedron':
			count += 4
		elif word == 'Cube':
			count += 6
		elif word == 'Octahedron':
			count += 8
		elif word == 'Dodecahedron':
			count += 12
		else:
			count += 20
		n -= 1
	print(count)
main()


n = int(input())
cont = 0
for i in range(n):
	name = input()
	if name == 'Icosahedron':
		cont += 20
	elif name == 'Cube':
		cont += 6
	elif name == 'Octahedron':
		cont += 8
	elif name == 'Tetrahedron':
		cont += 4
	else:
		cont += 12
print(cont)


n = int(input())
a = 'Tetrahedron'
b = 'Cube'
c = 'Octahedron'
d = 'Dodecahedron'
e = 'Icosahedron'
count = 0
for i in range(0, n):
	str1 = input()
	if str1 == a:
		count += 4
	elif str1 == b:
		count += 6
	elif str1 == c:
		count += 8
	elif str1 == d:
		count += 12
	elif str1 == e:
		count += 20
print(count)


Polyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
faces = []
for i in range(0, n):
	faces.append(Polyhedrons[input()])
print(sum(faces))


n = int(input())
di = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
s = 0
for x in range(n):
	s += di[str(input())]
print(s)


hash_map = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
N = int(input())
i = 0
total = 0
while i < N:
	total += hash_map[input()]
	i += 1
print(total)


k = int(input())
result = 0
while k > 0:
	temp = input()
	if temp == 'Tetrahedron':
		result = result + 4
	elif temp == 'Cube':
		result = result + 6
	elif temp == 'Octahedron':
		result = result + 8
	elif temp == 'Dodecahedron':
		result = result + 12
	elif temp == 'Icosahedron':
		result = result + 20
	k = k - 1
print(result)


n = int(input())
l = []
for i in range(n):
	l.append(input())
polyhedrons = {'Tetrahedron': '4', 'Octahedron': '8', 'Cube': '6', 'Icosahedron': '20', 'Dodecahedron': '12'}
number_of_faces = 0
for i in l:
	number_of_faces += int(polyhedrons.get(i))
print(number_of_faces)


n = int(input())
arr = []
for _ in range(n):
	arr.append(input())
faces = 0
for i in arr:
	if i[0] == 'T':
		faces += 4
	elif i[0] == 'C':
		faces += 6
	elif i[0] == 'O':
		faces += 8
	elif i[0] == 'D':
		faces += 12
	elif i[0] == 'I':
		faces += 20
print(faces)


q = int(input())
ans = 0
for i in range(q):
	z = input()
	if z == 'Tetrahedron':
		ans += 4
	if z == 'Cube':
		ans += 6
	if z == 'Octahedron':
		ans += 8
	if z == 'Dodecahedron':
		ans += 12
	if z == 'Icosahedron':
		ans += 20
print(ans)


n = int(input())
m = list(range(n))
for i in range(n):
	m[i] = input()

def triangularFaces(str):
	if str == 'Tetrahedron':
		return 4
	elif str == 'Cube':
		return 6
	elif str == 'Octahedron':
		return 8
	elif str == 'Dodecahedron':
		return 12
	elif str == 'Icosahedron':
		return 20
sum = 0
for i in range(len(m)):
	sum = sum + triangularFaces(m[i])
print(sum)


def solution():
	answers = int(input())
	result = 0
	for i in range(answers):
		intermidiate = input()
		if intermidiate == 'Tetrahedron':
			result += 4
		elif intermidiate == 'Cube':
			result += 6
		elif intermidiate == 'Octahedron':
			result += 8
		elif intermidiate == 'Dodecahedron':
			result += 12
		else:
			result += 20
	print(result)

def array_to_int(array):
	for i in range(len(array)):
		array[i] = int(array[i])
	return array
solution()


n = int(input())
shapes = {'Icosahedron': 20, 'Cube': 6, 'Tetrahedron': 4, 'Octahedron': 8, 'Dodecahedron': 12}
sides = 0
while n > 0:
	shape = input()
	sides += shapes[shape]
	n -= 1
print(sides)


def main():
	number_of_polyhedrons = int(input())
	polyhedrons = []
	triangular_faces = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	for i in range(number_of_polyhedrons):
		polyhedron = input()
		polyhedrons.append(polyhedron)
	total_number_of_faces = 0
	for polyhedron in polyhedrons:
		total_number_of_faces += triangular_faces[polyhedron]
	print(total_number_of_faces)
main()


def solve(arr):
	data = {'icosahedron': 20, 'cube': 6, 'tetrahedron': 4, 'dodecahedron': 12, 'octahedron': 8}
	return data[arr.lower()]
ans = 0
for i in range(int(input())):
	ans += solve(input())
print(ans)


test = int(input())
x = 0
while test > 0:
	a = input()
	if a == 'Tetrahedron':
		x += 4
	elif a == 'Cube':
		x += 6
	elif a == 'Dodecahedron':
		x += 12
	elif a == 'Octahedron':
		x += 8
	else:
		x += 20
	test -= 1
print(x)


n = int(input())
a = 'Tetrahedron'
b = 'Cube'
c = 'Octahedron'
d = 'Dodecahedron'
e = 'Icosahedron'
l = []
sum = 0
j = 0
for i in range(n):
	t = input()
	if t == e:
		j = 20
	elif t == d:
		j = 12
	elif t == c:
		j = 8
	elif t == b:
		j = 6
	elif t == a:
		j = 4
	sum = sum + j
print(sum)


n = int(input())
o = []
v = {'Cube': 6, 'Tetrahedron': 4, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(n):
	k = input()
	if k in v:
		o.append(v[k])
print(sum(o))


n = int(input())
s1 = 'Tetrahedron'
s2 = 'Cube'
s3 = 'Octahedron'
s4 = 'Dodecahedron'
s5 = 'Icosahedron'
c = 0
while n is not 0:
	n1 = input()
	if n1 == s1:
		c += 4
	elif n1 == s2:
		c += 6
	elif n1 == s3:
		c += 8
	elif n1 == s4:
		c += 12
	elif n1 == s5:
		c += 20
	n = n - 1
print(c)


number = int(input())
sum = 0
for n in range(number):
	polyhedron = input()
	if polyhedron == 'Tetrahedron':
		sum = sum + 4
	if polyhedron == 'Cube':
		sum = sum + 6
	if polyhedron == 'Octahedron':
		sum = sum + 8
	if polyhedron == 'Dodecahedron':
		sum = sum + 12
	if polyhedron == 'Icosahedron':
		sum = sum + 20
print(sum)


figures = {'Tetrahedron': 4, 'Icosahedron': 20, 'Cube': 6, 'Dodecahedron': 12, 'Octahedron': 8}
sum_ = 0
count = int(input())
if count > 200000:
	count = 200000
for _ in range(count):
	sum_ += figures[input().strip()]
print(sum_)


names = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
num = [4, 6, 8, 12, 20]
n = int(input())
res = 0
for i in range(n):
	s = input()
	res += num[names.index(s)]
print(res)


s = int(input())
face = 0
for i in range(s):
	m = input()
	if m == 'Tetrahedron':
		face += 4
	elif m == 'Cube':
		face += 6
	elif m == 'Octahedron':
		face += 8
	elif m == 'Dodecahedron':
		face += 12
	elif m == 'Icosahedron':
		face += 20
print(face)


count = 0
for _ in range(int(input())):
	shape = input()
	if shape == 'Tetrahedron':
		count += 4
	elif shape == 'Cube':
		count += 6
	elif shape == 'Octahedron':
		count += 8
	elif shape == 'Dodecahedron':
		count += 12
	elif shape == 'Icosahedron':
		count += 20
	else:
		count += 0
print(count)


dic = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
x = int(input())
z = []
while x != 0:
	y = input()
	a = dic.get(y)
	z.append(a)
	x = x - 1
print(sum(z))


n = int(input())
shapes = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
print(sum([shapes[input()] for k in range(n)]))


a = int(input())
arr = []
for i in range(a):
	data = input()
	arr.append(data)
faces = 0
for i in arr:
	if i == 'Tetrahedron':
		faces += 4
	elif i == 'Cube':
		faces += 6
	elif i == 'Octahedron':
		faces += 8
	elif i == 'Dodecahedron':
		faces += 12
	elif i == 'Icosahedron':
		faces += 20
print(faces)


n = int(input())
di = {}
di['Tetrahedron'] = 4
di['Cube'] = 6
di['Octahedron'] = 8
di['Dodecahedron'] = 12
di['Icosahedron'] = 20
r = 0
for i in range(n):
	x = input()
	r += di[x]
print(r)


t = int(input())
sc = 0
while t > 0:
	t = t - 1
	s = input()
	if s[0] == 'T':
		sc = sc + 4
	elif s[0] == 'C':
		sc = sc + 6
	elif s[0] == 'O':
		sc = sc + 8
	elif s[0] == 'D':
		sc = sc + 12
	elif s[0] == 'I':
		sc = sc + 20
print(sc)


mp = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
ans = 0
for i in range(n):
	s = input().strip()
	ans += mp[s]
print(ans)


n = int(input())
s = []
while n != 0:
	s.append(input())
	n -= 1
res = 0
for p in s:
	if p == 'Tetrahedron':
		res += 4
	if p == 'Cube':
		res += 6
	if p == 'Octahedron':
		res += 8
	if p == 'Dodecahedron':
		res += 12
	if p == 'Icosahedron':
		res += 20
print(res)


n = int(input())
dic = {'Cube': 6, 'Tetrahedron': 4, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
t = 0
for i in range(n):
	t += dic[input()]
print(t)


__author__ = 'Alexander'

def Task(n) -> int:
	val = [0, 0, 0, 0, 0]
	words = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
	for i in range(n):
		word = input()
		j = words.index(word)
		val[j] += 1
	res = val[0] * 4 + val[1] * 6 + val[2] * 8 + val[3] * 12 + val[4] * 20
	return res

def Main():
	n = input()
	print(Task(int(n)))

def Test():
	assert Task() == 1
	assert Task() == 2
Main()


L = [0] * 4 + ['Tetrahedron', 0, 'Cube', 0, 'Octahedron'] + [0] * 3 + ['Dodecahedron'] + [0] * 7 + ['Icosahedron']
n = int(input())
face = 0
for i in range(n):
	face += L.index(input())
print(face)


import math
import bisect
from math import gcd, floor, sqrt, log
from collections import defaultdict as dd
from collections import Counter
I = lambda : int(input())
tup = lambda : map(int, input().split())
lst = lambda : list(map(int, input().split()))
t = 1
while t:
	n = I()
	temp = {'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20, 'Tetrahedron': 4}
	ans = 0
	for i in range(n):
		s = input()
		ans += temp[s]
	print(ans)
	t -= 1


n = int(input())
dic = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
ans = 0
for s in range(0, n):
	st = input()
	ans += dic[st]
print(ans)


def polyhedrons():
	res = 0
	number_of_poly = int(input())
	for i in range(number_of_poly):
		pol = input()
		if pol == 'Tetrahedron':
			res += 4
		elif pol == 'Cube':
			res += 6
		elif pol == 'Octahedron':
			res += 8
		elif pol == 'Dodecahedron':
			res += 12
		elif pol == 'Icosahedron':
			res += 20
	print(res)
polyhedrons()


import sys
l = int(input())
compteur = 0
dico = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for _ in range(l):
	h = input()
	if h in dico:
		compteur += dico[h]
print(compteur)


count = dict()
count['Cube'] = 6
count['Tetrahedron'] = 4
count['Octahedron'] = 8
count['Dodecahedron'] = 12
count['Icosahedron'] = 20
n = int(input())
ans = 0
for i in range(n):
	x = input()
	ans += count[x]
print(ans)


number = int(input())
input_poly = []
polyhedrons = {'Icosahedron': 20, 'Dodecahedron': 12, 'Octahedron': 8, 'Cube': 6, 'Tetrahedron': 4}
for x in range(number):
	string = input()
	input_poly.append(string)
total = 0
for x in range(number):
	total += polyhedrons[input_poly[x]]
print(total)


from sys import stdin
ans = 0
for _ in range(int(stdin.readline())):
	s = stdin.readline().rstrip()
	if s == 'Tetrahedron':
		ans += 4
	elif s == 'Cube':
		ans += 6
	elif s == 'Octahedron':
		ans += 8
	elif s == 'Dodecahedron':
		ans += 12
	else:
		ans += 20
print(ans)


import sys

def solve():
	n = int(input())
	ans = 0
	for i in range(n):
		temp = input()[0:2]
		if temp == 'Te':
			ans += 4
		elif temp == 'Cu':
			ans += 6
		elif temp == 'Oc':
			ans += 8
		elif temp == 'Do':
			ans += 12
		else:
			ans += 20
	return ans
ans = solve()
print(ans)


n = int(input())
total = 0
while n > 0:
	shape = input().lower()
	if shape == 'tetrahedron':
		total += 4
	elif shape == 'cube':
		total += 6
	elif shape == 'octahedron':
		total += 8
	elif shape == 'dodecahedron':
		total += 12
	elif shape == 'icosahedron':
		total += 20
	n -= 1
print(total)


x = int(input())
p = 0
for i in range(x):
	ch = input()
	if ch == 'Tetrahedron':
		p += 4
	elif ch == 'Cube':
		p += 6
	elif ch == 'Octahedron':
		p += 8
	elif ch == 'Dodecahedron':
		p += 12
	else:
		p += 20
print(p)


shapeMap = {}
shapeMap['I'] = 20
shapeMap['D'] = 12
shapeMap['O'] = 8
shapeMap['C'] = 6
shapeMap['T'] = 4
total = 0
for i in range(int(input())):
	shape = input()
	total += shapeMap.get(shape[0])
print(total)


faces = dict()
faces['Tetrahedron'] = 4
faces['Cube'] = 6
faces['Octahedron'] = 8
faces['Dodecahedron'] = 12
faces['Icosahedron'] = 20
n = int(input())
cnt = 0
for i in range(n):
	cnt += faces[input().strip()]
print(cnt)


n = int(input())
slova = {'Cube': 6, 'Tetrahedron': 4, 'Dodecahedron': 12, 'Icosahedron': 20, 'Octahedron': 8}
tot = 0
for i in range(n):
	tot += slova[input()]
print(tot)


from typing import List

class Polyhedrons:
	__SHAPES = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}

	def find_no_faces(self) -> int:
		no_of_faces = 0
		for shape in self.shapes:
			if shape in self.__SHAPES:
				no_of_faces += self.__SHAPES[shape]
		return no_of_faces

	def get_shapes(self, count):
		self.shapes = []
		if count > 0 and count <= 200000:
			for c in range(count):
				self.shapes.append(input())
no_of_polyhedrons = int(input())
poly = Polyhedrons()
poly.get_shapes(no_of_polyhedrons)
print(poly.find_no_faces())


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
num = inp()
strings = []
while num > 0:
	strings.append(input().strip())
	num -= 1
sides = 0
for string in strings:
	if string == 'Tetrahedron':
		sides += 4
	elif string == 'Cube':
		sides += 6
	elif string == 'Octahedron':
		sides += 8
	elif string == 'Dodecahedron':
		sides += 12
	elif string == 'Icosahedron':
		sides += 20
print(sides)


t = int(input())
k = []
for i in range(t):
	x = input()
	if x == 'Tetrahedron':
		k.append(4)
	elif x == 'Cube':
		k.append(6)
	elif x == 'Octahedron':
		k.append(8)
	elif x == 'Dodecahedron':
		k.append(12)
	else:
		k.append(20)
print(sum(k))


c = 0
for u in range(int(input())):
	s = input()
	if s == 'Cube':
		c = c + 6
	elif s == 'Octahedron':
		c = c + 8
	elif s == 'Tetrahedron':
		c = c + 4
	elif s == 'Icosahedron':
		c = c + 20
	elif s == 'Dodecahedron':
		c = c + 12
print(c)


no_of_faces = 0
for i in range(int(input())):
	phd = input()
	if phd == 'Tetrahedron':
		no_of_faces += 4
	elif phd == 'Cube':
		no_of_faces += 6
	elif phd == 'Octahedron':
		no_of_faces += 8
	elif phd == 'Dodecahedron':
		no_of_faces += 12
	elif phd == 'Icosahedron':
		no_of_faces += 20
print(no_of_faces)


from sys import exit
n = int(input())
su = 0
while n > 0:
	s = input()
	if s[0] == 'T':
		su += 4
	elif s[0] == 'C':
		su += 6
	elif s[0] == 'O':
		su += 8
	elif s[0] == 'D':
		su += 12
	else:
		su += 20
	n -= 1
print(su)


t = int(input())
count = 0
for i in range(t):
	s = input()
	if 'Icosa' in s:
		count += 20
	elif 'Cube' in s:
		count += 6
	elif 'Tetra' in s:
		count += 4
	elif 'Dodeca' in s:
		count += 12
	elif 'Octa' in s:
		count += 8
print(count)


x = int(input())
soma = 0
for i in range(x):
	m = input()
	if m == 'Tetrahedron':
		soma += 4
	elif m == 'Cube':
		soma += 6
	elif m == 'Octahedron':
		soma += 8
	elif m == 'Dodecahedron':
		soma += 12
	elif m == 'Icosahedron':
		soma += 20
print(soma)


D = dict()
D['Tetrahedron'] = 4
D['Cube'] = 6
D['Octahedron'] = 8
D['Dodecahedron'] = 12
D['Icosahedron'] = 20
a = int(input())
s = 0
for x in range(0, a):
	ch = input()
	s += D[ch]
print(s)


k = int(input())
list = []
sum = 0
for i in range(k):
	list.append(input())
for s in list:
	if s == 'Tetrahedron':
		sum += 4
	elif s == 'Cube':
		sum += 6
	elif s == 'Octahedron':
		sum += 8
	elif s == 'Dodecahedron':
		sum += 12
	elif s == 'Icosahedron':
		sum += 20
print(sum)


n = int(input())
t = 'Tetrahedron'
c = 'Cube'
o = 'Octahedron'
d = 'Dodecahedron'
q = 'Icosahedron'
b = 0
a = []
for i in range(n):
	a.append(input())
for i in range(n):
	if c in a[i - 1]:
		b = b + 6
	elif t in a[i - 1]:
		b = b + 4
	elif o in a[i - 1]:
		b = b + 8
	elif d in a[i - 1]:
		b = b + 12
	elif q in a[i - 1]:
		b = b + 20
print(b)


a = {'Cube': 6, 'Icosahedron': 20, 'Octahedron': 8, 'Dodecahedron': 12, 'Tetrahedron': 4}
b = input()
b = int(b)
c = []
for i in range(b):
	d = input()
	c.append(d)
sum = 0
for i in c:
	sum = sum + int(a[i])
print(sum)


figures = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
length = int(input())
answer = 0
for l in range(length):
	answer += figures[input()]
print(answer)


face_map = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}

def solve(n):
	count = 0
	for _ in range(n):
		l = input()
		count += face_map[l]
	return count

def main():
	n = int(input())
	print(solve(n))
main()


from sys import stdin as s
b = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
input()
print(sum((b[l.rstrip()[0]] for l in s.readlines())))


n = int(input())
face = 0
for i in range(n):
	c = input()
	if c[0] == 'T':
		face += 4
	elif c[0] == 'C':
		face += 6
	elif c[0] == 'O':
		face += 8
	elif c[0] == 'D':
		face += 12
	elif c[0] == 'I':
		face += 20
print(face)


faces = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}

def main():
	cases = int(input())
	_sum = 0
	while cases:
		_sum += faces[input()]
		cases -= 1
	print(_sum)
main()


from sys import stdin
number_polyhedrons = int(stdin.readline())
dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
faces = 0
for i in range(number_polyhedrons):
	string = stdin.readline().strip()
	faces += dict[string]
print(faces)


data = input()
n = int(data)
counter = 0
for i in range(n):
	input_str = str(input())
	if input_str == 'Tetrahedron':
		counter += 4
	elif input_str == 'Cube':
		counter += 6
	elif input_str == 'Octahedron':
		counter += 8
	elif input_str == 'Dodecahedron':
		counter += 12
	elif input_str == 'Icosahedron':
		counter += 20
print(counter)


n = int(input())
face = 0
if n >= 1 and n <= 200000:
	for i in range(n):
		poly = input()
		if poly == 'Tetrahedron':
			face = face + 4
		elif poly == 'Cube':
			face = face + 6
		elif poly == 'Octahedron':
			face = face + 8
		elif poly == 'Dodecahedron':
			face = face + 12
		elif poly == 'Icosahedron':
			face = face + 20
	print(face)


polyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
total = 0
for _ in range(n):
	total += polyhedrons[input()]
print(total)


n = int(input())
ls = []
poly = [['Tetrahedron', 4], ['Cube', 6], ['Octahedron', 8], ['Dodecahedron', 12], ['Icosahedron', 20]]
for i in range(n):
	geo = input()
	ls.append(geo)
result = 0
for i in range(len(ls)):
	for inner in range(len(poly)):
		if ls[i] == poly[inner][0]:
			result += poly[inner][1]
print(result)


ovidhan = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
kotobar = int(input())
jogfol = 0
for i in range(kotobar):
	jogfol = jogfol + ovidhan[input()]
print(jogfol)


from sys import stdin
max_val = int(10000000000000.0)
min_val = int(-10000000000000.0)

def read_int():
	return int(stdin.readline())

def read_ints():
	return [int(x) for x in stdin.readline().split()]

def read_str():
	return input()

def read_strs():
	return [x for x in stdin.readline().split()]
sides = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
ans = 0
nb_test = read_int()
for _ in range(nb_test):
	ans += sides[input()]
print(ans)


n = int(input())
l = []
sum = 0
dic = {'Icosahedron': 20, 'Dodecahedron': 12, 'Octahedron': 8, 'Cube': 6, 'Tetrahedron': 4}
for i in range(n):
	x = input()
	sum += dic[x]
print(sum)


t = int(input())
a = []
for i in range(t):
	s = str(input())
	a.append(s)
sum = 0
for i in range(len(a)):
	if a[i][0] == 'T':
		a[i] = 4
	elif a[i][0] == 'C':
		a[i] = 6
	elif a[i][0] == 'O':
		a[i] = 8
	elif a[i][0] == 'D':
		a[i] = 12
	else:
		a[i] = 20
for i in range(len(a)):
	sum = sum + int(a[i])
print(sum)


n = int(input())
sum1 = 0
na = []
for i in range(n):
	na.append(input())
for c in na:
	if c == 'Tetrahedron':
		sum1 += 4
	elif c == 'Cube':
		sum1 += 6
	elif c == 'Octahedron':
		sum1 += 8
	elif c == 'Dodecahedron':
		sum1 += 12
	else:
		sum1 += 20
print(sum1)


tet = 4
cube = 6
oc = 8
dod = 12
ico = 20
x = int(input())
ans = 0
for _ in range(x):
	i = input()
	if i == 'Tetrahedron':
		ans += tet
	elif i == 'Cube':
		ans += cube
	elif i == 'Octahedron':
		ans += oc
	elif i == 'Dodecahedron':
		ans += dod
	elif i == 'Icosahedron':
		ans += ico
print(ans)


number = int(input())
figures = []
faces = 0
shapes = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
for i in range(0, number):
	figures.append(input())
for i in figures:
	if i == shapes[0]:
		faces += 4
	elif i == shapes[1]:
		faces += 6
	elif i == shapes[2]:
		faces += 8
	elif i == shapes[3]:
		faces += 12
	elif i == shapes[4]:
		faces += 20
print(faces)


n = int(input(''))
count = 0
for i in range(n):
	st = input('')
	if st.lower() == 'tetrahedron':
		count = count + 4
	elif st.lower() == 'cube':
		count = count + 6
	elif st.lower() == 'octahedron':
		count = count + 8
	elif st.lower() == 'dodecahedron':
		count = count + 12
	elif st.lower() == 'icosahedron':
		count = count + 20
print(count)


import sys
n = int(input())
nf = 0
for i in range(n):
	temp = input()
	if temp == 'Tetrahedron':
		nf += 4
	elif temp == 'Cube':
		nf += 6
	elif temp == 'Octahedron':
		nf += 8
	elif temp == 'Dodecahedron':
		nf += 12
	else:
		nf += 20
print(nf)
sys.exit()


n = int(input())
shapes = [input() for i in range(n)]
icos = shapes.count('Icosahedron')
dode = shapes.count('Dodecahedron')
octa = shapes.count('Octahedron')
cube = shapes.count('Cube')
tetr = shapes.count('Tetrahedron')
print(20 * icos + 12 * dode + 8 * octa + 6 * cube + tetr * 4)


str_to_int = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
sum = 0
for i in range(int(input())):
	s = input()
	sum += str_to_int[s]
print(sum)


k = {'Icosahedron': 20, 'Dodecahedron': 12, 'Octahedron': 8, 'Hexahedron': 6, 'Tetrahedron': 4, 'Cube': 6}
n = input()
count = 0
for i in range(int(n)):
	count += k[input()]
print(count)


def polyhedron(n, a):
	v = 0
	polyhedrons = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
	sides = [4, 6, 8, 12, 20]
	for i in range(n):
		v += sides[polyhedrons.index(a[i])]
	return v
n = int(input().strip())
a = []
for i in range(n):
	a.append(input().strip())
print(polyhedron(n, a))


num = int(input())
actors = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
total = 0
for i in range(num):
	s = input()
	for (key, val) in actors.items():
		if s in key:
			total += val
print(total)


n = int(input())
all_fig = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
sum_g = 0
for i in range(n):
	tmp_str = input()
	sum_g += all_fig[tmp_str]
print(sum_g)


import math as mt
import sys, string, bisect
input = sys.stdin.readline
import random
from collections import deque, defaultdict
L = lambda : list(map(int, input().split()))
Ls = lambda : list(input().split())
M = lambda : map(int, input().split())
I = lambda : int(input())
d = {}
d['Tetrahedron'] = 4
d['Cube'] = 6
d['Octahedron'] = 8
d['Dodecahedron'] = 12
d['Icosahedron'] = 20
n = I()
ans = 0
for i in range(n):
	s = input().strip()
	ans += d[s]
print(ans)


R = lambda : [*map(int, input().split())]
a = R()
ans = 0
s = ''
for i in range(a[0]):
	s = input()
	if s == 'Tetrahedron':
		ans += 4
	elif s == 'Cube':
		ans += 6
	elif s == 'Octahedron':
		ans += 8
	elif s == 'Dodecahedron':
		ans += 12
	elif s == 'Icosahedron':
		ans += 20
print(ans)


n = int(input())
faces = []
sum_faces = 0
dic = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(n):
	face = input()
	sum_faces += dic[face]
print(sum_faces)


n = int(input())
m = list(range(n))
for i in range(n):
	m[i] = input()
arr = {}
arr['Tetrahedron'] = 4
arr['Cube'] = 6
arr['Octahedron'] = 8
arr['Dodecahedron'] = 12
arr['Icosahedron'] = 20
sum = 0
for i in range(len(m)):
	sum = sum + arr[m[i]]
print(sum)


def countSides(side):
	if side[0] == 'T':
		return 4
	if side[0] == 'C':
		return 6
	if side[0] == 'O':
		return 8
	if side[0] == 'D':
		return 12
	if side[0] == 'I':
		return 20
n = int(input())
count = 0
for i in range(n):
	side = input()
	count += countSides(side)
print(count)


numofhedrons = int(input(''))
faces = 0
for i in range(numofhedrons):
	hedron = input('')
	if 'tetra' in hedron.lower():
		faces += 4
	elif 'cube' in hedron.lower():
		faces += 6
	elif 'octa' in hedron.lower():
		faces += 8
	elif 'dodeca' in hedron.lower():
		faces += 12
	elif 'icosah' in hedron.lower():
		faces += 20
print(faces)


map = dict()
map['Tetrahedron'] = 4
map['Cube'] = 6
map['Octahedron'] = 8
map['Dodecahedron'] = 12
map['Icosahedron'] = 20
nbr = input()
nbr = int(nbr)
res = 0
while nbr != 0:
	temp = input()
	res += map[temp]
	nbr -= 1
print(res)


polyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
sum = 0
for _ in range(int(input())):
	a = input()
	sum += polyhedrons[a]
print(sum)


n = int(input())
res = int()
for x in range(n):
	inp = input().lower()
	if inp == 'tetrahedron':
		res += 4
	elif inp == 'cube':
		res += 6
	elif inp == 'octahedron':
		res += 8
	elif inp == 'dodecahedron':
		res += 12
	elif inp == 'icosahedron':
		res += 20
print(res)


a = int(input())
faces = 0
for i in range(a):
	s = input()
	if s == 'Tetrahedron':
		faces += 4
	elif s == 'Cube':
		faces += 6
	elif s == 'Octahedron':
		faces += 8
	elif s == 'Dodecahedron':
		faces += 12
	elif s == 'Icosahedron':
		faces += 20
	else:
		continue
print(faces)


count = input()
mth = 0
for i in range(int(count)):
	name = input()
	if name[0] == 'C':
		mth = mth + 6
	elif name[0] == 'I':
		mth = mth + 20
	elif name[0] == 'D':
		mth = mth + 12
	elif name[0] == 'O':
		mth = mth + 8
	elif name[0] == 'T':
		mth = mth + 4
print(mth)


count = int(input())

def getFaces(geo):
	if geo == 'Tetrahedron':
		return 4
	if geo == 'Cube':
		return 6
	if geo == 'Octahedron':
		return 8
	if geo == 'Dodecahedron':
		return 12
	if geo == 'Icosahedron':
		return 20
faces = 0
for _ in range(0, count):
	faces += getFaces(input())
print(faces)


n = int(input())
k = 0
finalList = []
while k < n:
	m = input()
	shapeValue = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	finalList.append(shapeValue[m])
	k += 1
sumList = sum(finalList)
print(sumList)


n = int(input())
names = []
sumOfSide = 0
for i in range(n):
	names.append(input())
	if names[i] == 'Tetrahedron':
		sumOfSide += 4
	if names[i] == 'Cube':
		sumOfSide += 6
	if names[i] == 'Octahedron':
		sumOfSide += 8
	if names[i] == 'Dodecahedron':
		sumOfSide += 12
	if names[i] == 'Icosahedron':
		sumOfSide += 20
print(sumOfSide)


n = int(input())
t = 'Tetrahedron'
k = 'Cube'
o = 'Octahedron'
d = 'Dodecahedron'
i = 'Icosahedron'
s = ''
otvet = 0
for i in range(n):
	s = input()
	if s == t:
		otvet += 4
	elif s == k:
		otvet += 6
	elif s == o:
		otvet += 8
	elif s == d:
		otvet += 12
	else:
		otvet += 20
print(otvet)


n = int(input())
name = []
faces = 0
for i in range(n):
	name.append(input())
for i in name:
	if i.__eq__('Tetrahedron'):
		faces += 4
	elif i.__eq__('Cube'):
		faces += 6
	elif i.__eq__('Octahedron'):
		faces += 8
	elif i.__eq__('Dodecahedron'):
		faces += 12
	elif i.__eq__('Icosahedron'):
		faces += 20
print(faces)


n = int(input())
total = 0
for i in range(n):
	temp = input()
	if temp[0] == 'T':
		total += 4
	elif temp[0] == 'C':
		total += 6
	elif temp[0] == 'O':
		total += 8
	elif temp[0] == 'D':
		total += 12
	else:
		total += 20
print(str(total))


dc = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
sm = 0
for i in range(int(input())):
	sm += dc[input()]
print(sm)


a = [['Tetrahedron', 4], ['Cube', 6], ['Octahedron', 8], ['Dodecahedron', 12], ['Icosahedron', 20]]
n = int(input())
result = 0
for _ in range(n):
	shape = input()
	for cube in a:
		if cube[0] == shape:
			result += cube[1]
			break
print(result)


n = int(input())
c = 0
m = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
while n > 0:
	c += m[input()[0]]
	n -= 1
print(c)


Poligonos = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
Total = 0
for NumeroDeVecesQueSePediraLaFigura in range(int(input())):
	Total += Poligonos[input()]
print(Total)


n = int(input())
r = ['T', 'C', 'O', 'D', 'I']
s = [4, 6, 8, 12, 20]
p = 0
for m in range(n):
	L = input()
	p += s[r.index(L[0])]
print(p)


def main():
	dict1 = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	ans = 0
	for _ in range(int(input())):
		ans += dict1[input()]
	print(ans)
main()


polyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
input_num = int(input())
list_input = []
face = 0
for i in range(input_num):
	list_input.append(input())
	face = face + polyhedrons[list_input[i]]
print(face)


z = int(input())
total = 0
for i in range(z):
	y = str(input())
	if y == 'Tetrahedron':
		total += 4
	elif y == 'Cube':
		total += 6
	elif y == 'Octahedron':
		total += 8
	elif y == 'Dodecahedron':
		total += 12
	elif y == 'Icosahedron':
		total += 20
print(total)


coll_len = int(input())
solids = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
faces = 0
for i in range(coll_len):
	faces += solids[str(input()[0])]
print(faces)


n = int(input())
s = []
m = 0
for i in range(n):
	s.append(input())
for k in s:
	if k == 'Tetrahedron':
		m += 4
	if k == 'Cube':
		m += 6
	if k == 'Octahedron':
		m += 8
	if k == 'Dodecahedron':
		m += 12
	if k == 'Icosahedron':
		m += 20
print(m)


poly = int(input())
sum = 0
for i in range(0, poly):
	hed = input()
	if hed == 'Tetrahedron':
		shape = 4
	elif hed == 'Cube':
		shape = 6
	elif hed == 'Octahedron':
		shape = 8
	elif hed == 'Dodecahedron':
		shape = 12
	elif hed == 'Icosahedron':
		shape = 20
	sum = sum + shape
	shape = 0
print(sum)


n = int(input())
faces = 0
plyhedrons = []
for i in range(n):
	k = input()
	plyhedrons.append(k)
for i in range(len(plyhedrons)):
	if plyhedrons[i] == 'Icosahedron':
		faces = faces + 20
	elif plyhedrons[i] == 'Dodecahedron':
		faces = faces + 12
	elif plyhedrons[i] == 'Octahedron':
		faces = faces + 8
	elif plyhedrons[i] == 'Cube':
		faces = faces + 6
	else:
		faces = faces + 4
print(faces)


import re
x = int(input())
faces = 0
shapes = []
for i in range(x):
	shapes.append(input())
for i in range(len(shapes)):
	if shapes[i] == 'Tetrahedron':
		faces += 4
	elif shapes[i] == 'Cube':
		faces += 6
	elif shapes[i] == 'Octahedron':
		faces += 8
	elif shapes[i] == 'Dodecahedron':
		faces += 12
	elif shapes[i] == 'Icosahedron':
		faces += 20
print(faces)


n = int(input())
count = 0
while n > 0:
	st = input().strip()
	if st == 'Tetrahedron':
		count += 4
	elif st == 'Cube':
		count += 6
	elif st == 'Octahedron':
		count += 8
	elif st == 'Dodecahedron':
		count += 12
	else:
		count += 20
	n -= 1
print(count)


a = int(input())
dic = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
sum = 0
for i in range(a):
	x = str(input())
	sum += dic[str(x)]
print(sum)


input_count = int(input())
total = 0
polyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(input_count):
	new_input = input()
	new_input_triangles = polyhedrons[new_input]
	total = total + new_input_triangles
print(total)


num = int(input())
summ = 0
for x in range(num):
	x = input()
	if x == 'Tetrahedron':
		summ += 4
	elif x == 'Cube':
		summ += 6
	elif x == 'Octahedron':
		summ += 8
	elif x == 'Dodecahedron':
		summ += 12
	elif x == 'Icosahedron':
		summ += 20
print(summ)


def check(inp):
	if inp == 'Tetrahedron':
		return 4
	elif inp == 'Cube':
		return 6
	elif inp == 'Dodecahedron':
		return 12
	elif inp == 'Octahedron':
		return 8
	elif inp == 'Icosahedron':
		return 20
n = int(input())
ls = []
for i in range(n):
	inp = input()
	ls.append(inp)
s = 0
for i in ls:
	s += check(i)
print(s)


poliedros = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
resp = 0
for pi in range(int(input())):
	resp += poliedros[input()]
print(resp)


sizes = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
N = int(input().strip())
count = {}
for i in range(N):
	poly = input().strip()
	try:
		count[poly] += 1
	except KeyError:
		count[poly] = 1
faces = 0
for (poly, count) in count.items():
	faces += sizes[poly] * count
print(faces)


n = int(input())
l = []
c = 0
for i in range(n):
	s = input()
	if s[0] == 'T':
		c += 4
	if s[0] == 'C':
		c += 6
	if s[0] == 'O':
		c += 8
	if s[0] == 'D':
		c += 12
	if s[0] == 'I':
		c += 20
print(c)


n = int(input())
m = 0
dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(n):
	ch = str(input())
	m = m + dict[ch]
print(m)


n = int(input())
k = 0
for i in range(n):
	S = input()
	if S == 'Tetrahedron':
		k = k + 4
	elif S == 'Cube':
		k = k + 6
	elif S == 'Octahedron':
		k = k + 8
	elif S == 'Dodecahedron':
		k = k + 12
	else:
		k = k + 20
print(k)


test = int(input())
D = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
result = 0
for x in range(test):
	str = input()
	result += D[str[0]]
print(result)


n = int(input())
ans = 0
for _ in range(n):
	s = str(input())
	if s == 'Tetrahedron':
		ans += 4
	elif s == 'Cube':
		ans += 6
	elif s == 'Octahedron':
		ans += 8
	elif s == 'Dodecahedron':
		ans += 12
	else:
		ans += 20
print(ans)


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
n = inp()
a = []
for i in range(n):
	a.append(input().replace('\n', ''))
count = 0
for i in range(n):
	if a[i] == 'Tetrahedron':
		count += 4
	elif a[i] == 'Cube':
		count += 6
	elif a[i] == 'Octahedron':
		count += 8
	elif a[i] == 'Dodecahedron':
		count += 12
	else:
		count += 20
print(count)


def sum(a):
	s = 0
	while a > 0:
		s = s + a % 10
		a //= 10
	return s
ans = 0
for i in range(int(input())):
	x = input()
	if x == 'Tetrahedron':
		ans += 4
	elif x == 'Cube':
		ans += 6
	elif x == 'Octahedron':
		ans += 8
	elif x == 'Dodecahedron':
		ans += 12
	elif x == 'Icosahedron':
		ans += 20
print(ans)


n = int(input())
l = []
for i in range(n):
	l.append(input())
m = 0
T = 4
C = 6
O = 8
D = 12
I = 20
for poly in l:
	if poly == 'Tetrahedron':
		m = m + 4
	if poly == 'Cube':
		m = m + 6
	if poly == 'Octahedron':
		m = m + 8
	if poly == 'Dodecahedron':
		m = m + 12
	if poly == 'Icosahedron':
		m = m + 20
print(m)


n = int(input())
res = 0
for i in range(0, n):
	m = input()
	if m == 'Tetrahedron':
		res += 4
	elif m == 'Cube':
		res += 6
	elif m == 'Octahedron':
		res += 8
	elif m == 'Dodecahedron':
		res += 12
	else:
		res += 20
	i += 1
print(res)


s = {'Cube': 6, 'Dodecahedron': 12, 'Icosahedron': 20, 'Octahedron': 8, 'Tetrahedron': 4}
c = []
n = int(input(''))
for i in range(n):
	c += [input('')]
print(sum((s[i] for i in c)))


n = int(input())
memo = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
count = 0
for i in range(n):
	poly = input().strip()
	count += memo[poly]
print(count)


u = []
dic = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
s = 0
n = int(input())
for i in range(0, n):
	u.append(str(input()))
for x in u:
	s += dic[x[0]]
print(s)


total = 0
for _ in range(int(input())):
	b = input()
	if b == 'Tetrahedron':
		total += 4
	elif b == 'Cube':
		total += 6
	elif b == 'Octahedron':
		total += 8
	elif b == 'Dodecahedron':
		total += 12
	elif b == 'Icosahedron':
		total += 20
print(total)


n = int(input())
s = []
dic = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
c = 0
for i in range(n):
	r = input()
	c += dic[r[0]]
print(c)


n = int(input())
f = 0
i = 0
while i < n:
	s = input()
	if s == 'Tetrahedron':
		f += 4
	elif s == 'Cube':
		f += 6
	elif s == 'Octahedron':
		f += 8
	elif s == 'Dodecahedron':
		f += 12
	elif s == 'Icosahedron':
		f += 20
	else:
		pass
	i += 1
print(f)


data = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
print(sum((data[input()] for i in range(int(input())))))


srrr = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
later = 0
for i in range(int(input())):
	later += srrr[input()]
print(later)


x = int(input())
sum = 0
y = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(x):
	z = input()
	sum = sum + y[z]
print(sum)


n = int(input())
items = []
count = 0
for _ in range(n):
	items.append(input())
for item in items:
	if item == 'Tetrahedron':
		count += 4
	elif item == 'Cube':
		count += 6
	elif item == 'Octahedron':
		count += 8
	elif item == 'Dodecahedron':
		count += 12
	elif item == 'Icosahedron':
		count += 20
print(count)


def main():
	while 1:
		try:
			n = int(input())
			sum_val = 0
			while n > 0:
				poly_type = input()
				sum_val += faces(poly_type)
				n -= 1
			print(sum_val)
		except:
			break

def faces(polyhedrons):
	polyType = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	return polyType[polyhedrons]
main()


n = int(input())
sum = 0
for i in range(n):
	a = input()
	if a[:2] == 'Te':
		sum = sum + 4
	elif a[:2] == 'Cu':
		sum = sum + 6
	elif a[:2] == 'Oc':
		sum = sum + 8
	elif a[:2] == 'Do':
		sum = sum + 12
	elif a[:2] == 'Ic':
		sum = sum + 20
	else:
		pass
print(sum)


values = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
number = int(input())
ans = 0
for i in range(number):
	ans += values[input()]
print(ans)


n = int(input())
count = 0
for _ in range(n):
	g = input().lower()
	if g == 'cube':
		count += 6
	elif g == 'tetrahedron':
		count += 4
	elif g == 'octahedron':
		count += 8
	elif g == 'dodecahedron':
		count += 12
	else:
		count += 20
print(count)


n = int(input())
input_name = [i for i in range(n)]
for i in range(n):
	input_name[i] = input()

def counting_faces(input_name):
	total_faces = 0
	for i in range(len(input_name)):
		if input_name[i] == 'Tetrahedron':
			total_faces = total_faces + 4
		if input_name[i] == 'Cube':
			total_faces = total_faces + 6
		if input_name[i] == 'Octahedron':
			total_faces = total_faces + 8
		if input_name[i] == 'Dodecahedron':
			total_faces = total_faces + 12
		if input_name[i] == 'Icosahedron':
			total_faces = total_faces + 20
	return total_faces
total_faces = counting_faces(input_name)
print(total_faces)


polys = int(input())
names = [input() for i in range(polys)]
faces = 0
for shapes in names:
	if shapes == 'Icosahedron':
		faces = faces + 20
	elif shapes == 'Cube':
		faces = faces + 6
	elif shapes == 'Tetrahedron':
		faces = faces + 4
	elif shapes == 'Octahedron':
		faces = faces + 8
	elif shapes == 'Dodecahedron':
		faces = faces + 12
print(faces)


polyhedron = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
lst = []
for i in range(0, n):
	st = input()
	lst.append(st)
faces = 0
for (key, value) in polyhedron.items():
	for ele in lst:
		if ele == key:
			faces += value
print(faces)


def main():
	c = 0
	for _ in range(int(input())):
		s = input().rstrip()
		if s == 'Tetrahedron':
			c += 4
		elif s == 'Cube':
			c += 6
		elif s == 'Octahedron':
			c += 8
		elif s == 'Dodecahedron':
			c += 12
		else:
			c += 20
	print(c)
main()


n = int(input())
lst = []
sides = 0
for i in range(n):
	lst.append(input().lower())
for i in lst:
	if i == 'tetrahedron':
		sides = sides + 4
	elif i == 'cube':
		sides = sides + 6
	elif i == 'octahedron':
		sides = sides + 8
	elif i == 'dodecahedron':
		sides = sides + 12
	elif i == 'icosahedron':
		sides = sides + 20
print(sides)


faces = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
objects_in_collection = int(input())
total_faces = 0
for _unk in range(objects_in_collection):
	total_faces += faces[input()]
print(total_faces)


ans = 0
a1 = [['Tetrahedron', 4], ['Cube', 6], ['Octahedron', 8], ['Dodecahedron', 12], ['Icosahedron', 20]]
for _ in range(int(input())):
	a = input()
	for i in a1:
		if i[0] == a:
			ans += i[1]
			break
print(ans)


num_of_polyhedrons = int(input())
total_faces = 0
for _ in range(num_of_polyhedrons):
	polyhedron = input()
	if polyhedron.lower() == 'tetrahedron':
		total_faces += 4
	elif polyhedron.lower() == 'cube':
		total_faces += 6
	elif polyhedron.lower() == 'octahedron':
		total_faces += 8
	elif polyhedron.lower() == 'dodecahedron':
		total_faces += 12
	elif polyhedron.lower() == 'icosahedron':
		total_faces += 20
print(total_faces)


n = int(input())
count = 0
for x in range(n):
	s = input()
	if s == 'Tetrahedron':
		count += 4
	elif s == 'Octahedron':
		count += 8
	elif s == 'Cube':
		count += 6
	elif s == 'Dodecahedron':
		count += 12
	elif s == 'Icosahedron':
		count += 20
print(count)


Polyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
s = []
faces = 0
for i in range(n):
	s.append(input())
for j in range(len(s)):
	faces += Polyhedrons[s[j]]
print(faces)


n = int(input())
gemetric_faces = 0
geometric_list = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
value_list = [4, 6, 8, 12, 20]
for i in range(n):
	geomatric = input()
	gemetric_faces += value_list[geometric_list.index(geomatric)]
print(gemetric_faces)


shapes = dict()
shapes['Tetrahedron'] = 4
shapes['Cube'] = 6
shapes['Octahedron'] = 8
shapes['Dodecahedron'] = 12
shapes['Icosahedron'] = 20
num_shapes = int(input())
total = 0
for _ in range(num_shapes):
	new_shape = input()
	total += shapes[new_shape]
print(total)


i = int(input())
a = []
for x in range(i):
	z = input()
	a.append(z)
num = 0
for x in a:
	if x == 'Tetrahedron':
		num += 4
	elif x == 'Cube':
		num += 6
	elif x == 'Octahedron':
		num += 8
	elif x == 'Dodecahedron':
		num += 12
	elif x == 'Icosahedron':
		num += 20
print(num)


n = int(input())
i = 0
num = list()
while i < n:
	num.append(input())
	i += 1
count = 0
for i in num:
	if i == 'Icosahedron':
		count += 20
	elif i == 'Octahedron':
		count += 8
	elif i == 'Tetrahedron':
		count += 4
	elif i == 'Cube':
		count += 6
	elif i == 'Dodecahedron':
		count += 12
print(count)


n = int(input())
slownik = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
lines = []
for i in range(n):
	line = input()
	if line:
		lines.append(line)
	else:
		break
faces = 0
for i in lines:
	faces += slownik[i]
print(faces)


n = int(input())
ans = 0
for i in range(n):
	p = input()[0]
	if p == 'T':
		ans += 4
	elif p == 'C':
		ans += 6
	elif p == 'O':
		ans += 8
	elif p == 'D':
		ans += 12
	elif p == 'I':
		ans += 20
print(ans)


faces = 0
num = int(input())
for i in range(num):
	structure = input()
	if structure == 'Tetrahedron':
		faces += 4
	elif structure == 'Cube':
		faces += 6
	elif structure == 'Octahedron':
		faces += 8
	elif structure == 'Dodecahedron':
		faces += 12
	elif structure == 'Icosahedron':
		faces += 20
print(faces)


n = int(input())
S = [input() for _ in range(n)]
L = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
nb_side = 0
for s in S:
	nb_side += L[s]
print(nb_side)


n = int(input())
collection = []
for i in range(n):
	s = input()
	collection.append(s)
faces = 0
total = 0
for each in collection:
	if each == 'Tetrahedron':
		faces = 4
	elif each == 'Cube':
		faces = 6
	elif each == 'Octahedron':
		faces = 8
	elif each == 'Dodecahedron':
		faces = 12
	elif each == 'Icosahedron':
		faces = 20
	total += faces
print(total)


x = int(input())
res = 0
for a in range(x):
	temp = input()
	if temp == 'Tetrahedron':
		res += 4
	elif temp == 'Cube':
		res += 6
	elif temp == 'Octahedron':
		res += 8
	elif temp == 'Dodecahedron':
		res += 12
	elif temp == 'Icosahedron':
		res += 20
print(res)


n = int(input())
count = 0
for i in range(0, n):
	l = input()
	if l[0] == 'T':
		count += 4
	elif l[0] == 'C':
		count += 6
	elif l[0] == 'O':
		count += 8
	elif l[0] == 'D':
		count += 12
	elif l[0] == 'I':
		count += 20
print(count)


n = int(input())
hashlist = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
ans = 0
for i in range(n):
	shp = str(input())
	ans += hashlist[shp]
print(ans)


a = input()
n = int(a)
result = 0
for x in range(0, n):
	word = input()
	if word == 'Tetrahedron':
		result = result + 4
	elif word == 'Cube':
		result = result + 6
	elif word == 'Octahedron':
		result = result + 8
	elif word == 'Dodecahedron':
		result = result + 12
	elif word == 'Icosahedron':
		result = result + 20
print(result)


Tetrahedron = 4
Cube = 6
Octahedron = 8
Dodecahedron = 12
Icosahedron = 20
num = int(input())
a = 0
result = 0
while a < num:
	polyhedron = input()
	if polyhedron == 'Tetrahedron':
		result = result + Tetrahedron
	elif polyhedron == 'Cube':
		result = result + Cube
	elif polyhedron == 'Octahedron':
		result = result + Octahedron
	elif polyhedron == 'Dodecahedron':
		result = result + Dodecahedron
	else:
		result = result + Icosahedron
	a = a + 1
print(result)


num_of_iterations = int(input())
sum = 0
for i in range(num_of_iterations):
	tmp = input()
	if tmp == 'Tetrahedron':
		sum += 4
	elif tmp == 'Cube':
		sum += 6
	elif tmp == 'Octahedron':
		sum += 8
	elif tmp == 'Dodecahedron':
		sum += 12
	elif tmp == 'Icosahedron':
		sum += 20
print(sum)


n = int(input())
i = 0
s = 0
while i < n:
	shape = input()
	if shape == 'Tetrahedron':
		s += 4
	elif shape == 'Cube':
		s += 6
	elif shape == 'Octahedron':
		s += 8
	elif shape == 'Dodecahedron':
		s += 12
	else:
		s += 20
	i += 1
print(s)


N = int(input())
n = sides = 0
poly = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
while not N == n:
	n += 1
	s = input()
	sides += poly[s]
print(sides)


dic = {'Cube': 6, 'Tetrahedron': 4, 'Dodecahedron': 12, 'Icosahedron': 20, 'Octahedron': 8}
n = int(input())
lis = [input() for i in range(n)]
sum = 0
for i in lis:
	sum += dic.get(i)
print(sum)


faces = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
poly = [input() for i in range(n)]
print(sum([faces[i] for i in poly]))


costs = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
answer = 0
for i in range(int(input())):
	answer += costs[input()[0]]
print(answer)


shp_dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
shp_list = []
faces = 0
n = int(input())
while n != 0:
	a = input()
	shp_list.append(a)
	n = n - 1
for s in shp_list:
	faces = faces + shp_dict.get(s)
print(faces)


n = int(input())
ans = 0
for i in range(n):
	fir = input()[0]
	if fir == 'I':
		ans += 20
	elif fir == 'C':
		ans += 6
	elif fir == 'O':
		ans += 8
	elif fir == 'D':
		ans += 12
	else:
		ans += 4
print(ans)


t = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
k = [4, 6, 8, 12, 20]
x = int(input())
s = 0
for i in range(x):
	c = input()
	ind = t.index(c)
	s += k[ind]
print(s)


n = int(input())
f = 0
for _ in range(n):
	s = input()
	if s == 'Icosahedron':
		f += 20
	elif s == 'Dodecahedron':
		f += 12
	elif s == 'Octahedron':
		f += 8
	elif s == 'Cube':
		f += 6
	else:
		f += 4
print(f)


dictionary = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
faces = 0
for _ in range(int(input())):
	shape = input().strip()
	faces += dictionary[shape]
print(faces)


import math
n = int(input())
suma = 0
for x in range(n):
	poly = input()
	if poly == 'Tetrahedron':
		suma = suma + 4
	elif poly == 'Cube':
		suma = suma + 6
	elif poly == 'Octahedron':
		suma = suma + 8
	elif poly == 'Dodecahedron':
		suma = suma + 12
	else:
		suma = suma + 20
print(suma)


n = int(input())
res = 0
while n > 0:
	st = input()
	n -= 1
	if st == 'Tetrahedron':
		res += 4
	elif st == 'Cube':
		res += 6
	elif st == 'Octahedron':
		res += 8
	elif st == 'Dodecahedron':
		res += 12
	else:
		res += 20
print(res, end='')


s = 0
for i in range(int(input())):
	k = str(input())
	if k == 'Tetrahedron':
		s += 4
	elif k == 'Cube':
		s += 6
	elif k == 'Octahedron':
		s += 8
	elif k == 'Dodecahedron':
		s += 12
	elif k == 'Icosahedron':
		s += 20
print(s)


n = int(input())
qtd = 0
for i in range(n):
	obj = input()
	if obj == 'Tetrahedron':
		qtd += 4
	elif obj == 'Cube':
		qtd += 6
	elif obj == 'Octahedron':
		qtd += 8
	elif obj == 'Dodecahedron':
		qtd += 12
	elif obj == 'Icosahedron':
		qtd += 20
print(qtd)


n = eval(input())
shapes = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
r = 0
i = 1
while i <= n:
	x = str(input())
	if x == shapes[0]:
		r += 4
	elif x == shapes[1]:
		r += 6
	elif x == shapes[2]:
		r += 8
	elif x == shapes[3]:
		r += 12
	elif x == shapes[4]:
		r += 20
	i += 1
print(r)


n = int(input())
res = 0
for i in range(n):
	name = input()
	if name == 'Icosahedron':
		res += 20
	elif name == 'Cube':
		res += 6
	elif name == 'Tetrahedron':
		res += 4
	elif name == 'Dodecahedron':
		res += 12
	else:
		res += 8
print(res)


n = int(input())
a = []
sides = 0
for i in range(n):
	b = input()
	a += b
	if b == 'Tetrahedron':
		sides += 4
	elif b == 'Cube':
		sides += 6
	elif b == 'Octahedron':
		sides += 8
	elif b == 'Dodecahedron':
		sides += 12
	elif b == 'Icosahedron':
		sides += 20
print(sides)


def compute(n):
	faces = 0
	face_dict = {'Icosahedron': 20, 'Cube': 6, 'Tetrahedron': 4, 'Dodecahedron': 12, 'Octahedron': 8}
	for _ in range(n):
		faces += face_dict[input()]
	print(faces)

def main():
	n = int(input())
	compute(n)
main()


import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue

class Scanner:

	@staticmethod
	def int():
		return int(sys.stdin.readline().rstrip())

	@staticmethod
	def string():
		return sys.stdin.readline().rstrip()

	@staticmethod
	def map_int():
		return [int(x) for x in Scanner.string().split()]

	@staticmethod
	def string_list(n):
		return [input() for i in range(n)]

	@staticmethod
	def int_list_list(n):
		return [Scanner.map_int() for i in range(n)]

	@staticmethod
	def int_cols_list(n):
		return [int(input()) for i in range(n)]

class Math:

	@staticmethod
	def gcd(a, b):
		if b == 0:
			return a
		return Math.gcd(b, a % b)

	@staticmethod
	def lcm(a, b):
		return a * b // Math.gcd(a, b)

	@staticmethod
	def round_up(a, b):
		return -(-a // b)

	@staticmethod
	def is_prime(n):
		if n < 2:
			return False
		if n == 2:
			return True
		if n % 2 == 0:
			return False
		d = int(n ** 0.5) + 1
		for i in range(3, d + 1, 2):
			if n % i == 0:
				return False
		return True

class PriorityQueue:

	def __init__(self, l=[]):
		self.q = l
		heapq.heapify(self.q)
		return

	def push(self, n):
		heapq.heappush(self.q, n)
		return

	def pop(self):
		return heapq.heappop(self.q)
MOD = int(1000000000.0) + 7
INF = int(1000000000000000.0)

def main():
	N = Scanner.int()
	S = Scanner.string_list(N)
	ans = 0
	LIST = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	for s in S:
		ans += LIST[s]
	print(ans)
main()


t = 0
for _ in range(int(input())):
	x = input()
	if x == 'Tetrahedron':
		t += 4
	elif x == 'Cube':
		t += 6
	elif x == 'Octahedron':
		t += 8
	elif x == 'Dodecahedron':
		t += 12
	elif x == 'Icosahedron':
		t += 20
print(t)


num_fig = int(input())
count_faces = 0
val = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(num_fig):
	count_faces = count_faces + val[input()]
print(count_faces)


n = int(input())
p = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
sum = 0
for i in range(n):
	a = input()
	sum += p[a]
print(sum)


t = int(input())
ans = 0
for i in range(1, t + 1):
	w = input()
	if w == 'Tetrahedron':
		ans += 4
	elif w == 'Cube':
		ans += 6
	elif w == 'Octahedron':
		ans += 8
	elif w == 'Dodecahedron':
		ans += 12
	elif w == 'Icosahedron':
		ans += 20
print(ans)


total = 0
num = int(input())
arr = []
for i in range(num):
	arr.append(input())
for i in range(num):
	if arr[i] == 'Tetrahedron':
		total = total + 4
	if arr[i] == 'Cube':
		total = total + 6
	if arr[i] == 'Octahedron':
		total = total + 8
	if arr[i] == 'Dodecahedron':
		total = total + 12
	if arr[i] == 'Icosahedron':
		total = total + 20
print(total)


try:
	ans = 0
	for _ in range(int(input())):
		s = input()
		if s == 'Tetrahedron':
			ans += 4
		elif s == 'Cube':
			ans += 6
		elif s == 'Octahedron':
			ans += 8
		elif s == 'Dodecahedron':
			ans += 12
		elif s == 'Icosahedron':
			ans += 20
	print(ans)
except EOFError as e:
	pass


num = int(input())
l = []

def sides(s):
	side = 0
	if s == 'Tetrahedron':
		side = 4
	elif s == 'Cube':
		side = 6
	elif s == 'Octahedron':
		side = 8
	elif s == 'Dodecahedron':
		side = 12
	elif s == 'Icosahedron':
		side = 20
	return side
for item in range(num):
	word = input()
	l.append(sides(word))
print(sum(l))


def main():
	cases = int(input())
	num = 0
	for i in range(cases):
		string = input()
		if string == 'Icosahedron':
			num += 20
		elif string == 'Cube':
			num += 6
		elif string == 'Octahedron':
			num += 8
		elif string == 'Dodecahedron':
			num += 12
		else:
			num += 4
	print(num)
main()


x = int(input())
a = []
for i in range(x):
	a.append(input())

def shapecount(n):
	if n == 'Tetrahedron':
		return 4
	elif n == 'Cube':
		return 6
	elif n == 'Octahedron':
		return 8
	elif n == 'Dodecahedron':
		return 12
	else:
		return 20
print(sum((shapecount(i) for i in a)))


n = int(input())
m = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
count = 0
for i in range(n):
	ele = input()
	count += m.get(ele)
print(count)


def main():
	numShapes = int(input())
	totalSides = 0
	for i in range(numShapes):
		shape = input()
		if shape == 'Icosahedron':
			totalSides += 20
		elif shape == 'Cube':
			totalSides += 6
		elif shape == 'Tetrahedron':
			totalSides += 4
		elif shape == 'Octahedron':
			totalSides += 8
		elif shape == 'Dodecahedron':
			totalSides += 12
		else:
			assert False
	print(totalSides)
main()


k = int(input())
shapes = []
for i in range(k):
	shapes.append(input())
answer = 0
for i in range(len(shapes)):
	if shapes[i][0] == 'T':
		answer += 4
	if shapes[i][0] == 'C':
		answer += 6
	if shapes[i][0] == 'O':
		answer += 8
	if shapes[i][0] == 'D':
		answer += 12
	if shapes[i][0] == 'I':
		answer += 20
print(answer)


N = int(input())
sum = 0
for i in range(0, N):
	S = input()
	if S == 'Tetrahedron':
		sum += 4
	if S == 'Cube':
		sum += 6
	if S == 'Octahedron':
		sum += 8
	if S == 'Dodecahedron':
		sum += 12
	if S == 'Icosahedron':
		sum += 20
print(sum)


geo_dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
ans = 0
for _ in range(n):
	call = input()
	ans += geo_dict[call]
print(ans)


index = int(input())
faces = 0
while index > 0:
	a = input()
	if a == 'Tetrahedron':
		faces = faces + 4
	if a == 'Cube':
		faces = faces + 6
	if a == 'Octahedron':
		faces = faces + 8
	if a == 'Dodecahedron':
		faces = faces + 12
	if a == 'Icosahedron':
		faces = faces + 20
	index = index - 1
print(faces)


n = int(input())
l = []
for i in range(n):
	s = input()
	if s[0] == 'I':
		l.append(20)
	elif s[0] == 'C':
		l.append(6)
	elif s[0] == 'T':
		l.append(4)
	elif s[0] == 'D':
		l.append(12)
	else:
		l.append(8)
print(sum(l))


n = int(input())
polyhedrons = [input() for i in range(n)]
total = 0
plane = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in polyhedrons:
	for (key, value) in plane.items():
		if i in key:
			total += value
print(total)


n = int(input())
sh = []
for i in range(0, n):
	sh.append(input().lower())
m = {'tetrahedron': 4, 'cube': 6, 'octahedron': 8, 'dodecahedron': 12, 'icosahedron': 20}
faces = 0
for s in sh:
	faces += m[s]
print(faces)


n = 0
for _ in range(int(input())):
	s = input()
	r = s.find('hedron')
	if r != -1:
		s = s[:r] + s[r + 6:]
	if s == 'Tetra':
		n += 4
	elif s == 'Icosa':
		n += 20
	elif s == 'Cube':
		n += 6
	elif s == 'Dodeca':
		n += 12
	elif s == 'Octa':
		n += 8
print(n)


d = [0] * 256
d[ord('T')] = 4
d[ord('C')] = 6
d[ord('O')] = 8
d[ord('D')] = 12
d[ord('I')] = 20
s = 0
n = int(input())
for i in range(n):
	c = input()[0]
	s += d[ord(c)]
print(s)


rp = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
s = 0
for _ in range(n):
	l = input()
	for (k, v) in rp.items():
		if k == l:
			s += v
			break
print(s)


tot = int(input())
tnum = 0
for _ in range(tot):
	s = input()[0]
	if s == 'T':
		tnum += 4
	elif s == 'C':
		tnum += 6
	elif s == 'O':
		tnum += 8
	elif s == 'D':
		tnum += 12
	else:
		tnum += 20
print(tnum)


def main():
	n = int(input())
	inputList = []
	count = 0
	for i in range(0, n):
		a = input()
		if a == 'Tetrahedron':
			count = count + 4
		elif a == 'Cube':
			count = count + 6
		elif a == 'Octahedron':
			count = count + 8
		elif a == 'Dodecahedron':
			count = count + 12
		elif a == 'Icosahedron':
			count = count + 20
	print(count)
main()


total_de_caras = 0
número_de_casos = int(input())
for a in range(1, número_de_casos + 1):
	b = input().strip()
	if b == 'Tetrahedron':
		b = 4
	elif b == 'Cube':
		b = 6
	elif b == 'Octahedron':
		b = 8
	elif b == 'Dodecahedron':
		b = 12
	elif b == 'Icosahedron':
		b = 20
	else:
		b = 0
	total_de_caras = total_de_caras + b
print(total_de_caras)


n = int(input())
faces_num = 0

def calc(inp):
	if inp == 'Tetrahedron':
		return 4
	elif inp == 'Cube':
		return 6
	elif inp == 'Octahedron':
		return 8
	elif inp == 'Dodecahedron':
		return 12
	elif inp == 'Icosahedron':
		return 20
for i in range(n):
	poly_type = str(input())
	faces_num += calc(poly_type)
print(faces_num)


a = int(input())
c = 0
lst = []
for i in range(a):
	c = input()
	lst.append(c)
sum = 0
for i in lst:
	if i == 'Icosahedron':
		sum = sum + 20
	elif i == 'Cube':
		sum = sum + 6
	elif i == 'Tetrahedron':
		sum = sum + 4
	elif i == 'Dodecahedron':
		sum = sum + 12
	else:
		sum = sum + 8
print(sum)


n = int(input())
answer = 0
edges = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(n):
	answer += edges[input()]
print(answer)


number = int(input())
face = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
fff = 0
for i in range(number):
	fff += face[input()]
print(fff)


tetra = 4
cube = 6
octa = 8
dode = 12
ico = 20
n = int(input())
faces = 0
for i in range(0, n):
	poly = str(input())
	if poly == 'Tetrahedron':
		faces += tetra
	elif poly == 'Cube':
		faces += cube
	elif poly == 'Octahedron':
		faces += octa
	elif poly == 'Dodecahedron':
		faces += dode
	elif poly == 'Icosahedron':
		faces += ico
print(faces)


def getInts():
	return [int(s) for s in input().split()]

def getInt():
	return int(input())

def getStrs():
	return [s for s in input().split()]

def getStr():
	return input()

def listStr():
	return list(input())

def solve():
	N = getInt()
	ans = 0
	faces = {'O': 8, 'I': 20, 'D': 12, 'C': 6, 'T': 4}
	for n in range(N):
		ans += faces[getStr()[0]]
	return ans
ans = solve()
print(ans)


n = eval(input())
m = 0
i = 1
Tetrahedron = 4
Cube = 6
Octahedron = 8
Dodecahedron = 12
Icosahedron = 20
for i in range(n):
	x = eval(input())
	m = m + x
print(m)


n = int(input())
ncount = 0
for i in range(n):
	a = input()
	if a == 'Dodecahedron':
		ncount += 12
	if a == 'Cube':
		ncount += 6
	if a == 'Icosahedron':
		ncount += 20
	if a == 'Tetrahedron':
		ncount += 4
	if a == 'Octahedron':
		ncount += 8
print(ncount)


n = int(input())
sides = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
faces = 0
for _ in range(n):
	poly = input()
	faces += sides[poly]
print(faces)


n = int(input())
faces = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
totalFaces = 0
for i in range(n):
	polyhedron = input()
	totalFaces = totalFaces + faces.get(polyhedron)
print(totalFaces)


n = int(input())
s = 0
for i in range(n):
	z = input()
	z = list(z)
	if z[0] == 'T':
		s = s + 4
	if z[0] == 'C':
		s = s + 6
	if z[0] == 'O':
		s = s + 8
	if z[0] == 'D':
		s = s + 12
	if z[0] == 'I':
		s = s + 20
print(s)


x = int(input())
dic = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
total = 0
z = []
for q in range(0, x):
	z.append(input())
for i in z:
	p = dic.get(i)
	total += p
print(total)


c = 0
dic = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(int(input())):
	s = input()
	c += dic[s]
print(c)


def main():
	mydic = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	t = int(input())
	summer = 0
	while t:
		stri = input()
		summer += mydic[stri]
		t -= 1
	print(summer)
main()


def main():
	n = int(input())
	k = []
	for i in range(n):
		k.append(input())
	faces = 0
	for i in k:
		if i == 'Tetrahedron':
			faces += 4
		elif i == 'Cube':
			faces += 6
		elif i == 'Octahedron':
			faces += 8
		elif i == 'Dodecahedron':
			faces += 12
		elif i == 'Icosahedron':
			faces += 20
	return print(faces)
main()


t = 'Tetrahedron'
c = 'Cube'
o = 'Octahedron'
d = 'Dodecahedron'
i = 'Icosahedron'
ts = 4
cs = 6
os = 8
ds = 12
Is = 20
total = 0
n = input()
for j in range(int(n)):
	p = input()
	if p == t:
		total += ts
	elif p == c:
		total += cs
	elif p == o:
		total += os
	elif p == d:
		total += ds
	elif p == i:
		total += Is
print(total)


n = int(input())
s = []
k = 0
a = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
b = [4, 6, 8, 12, 20]
while n > 0:
	s.append(input())
	n = n - 1
for i in s:
	k = k + b[a.index(i)]
print(k)


faces = 0
for _ in range(int(input())):
	s = list(input())
	if s[0] == 'T':
		faces += 4
	elif s[0] == 'C':
		faces += 6
	elif s[0] == 'O':
		faces += 8
	elif s[0] == 'D':
		faces += 12
	elif s[0] == 'I':
		faces += 20
print(faces)


cubes = int(input())
faces = 0
cube_dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(cubes):
	faces += cube_dict[input()]
print(faces)


n1 = int(input())
l = []
l1 = []
for i in range(n1):
	l.append(input())
for i in l:
	if i == 'Tetrahedron':
		l1.append(4)
	elif i == 'Cube':
		l1.append(6)
	elif i == 'Octahedron':
		l1.append(8)
	elif i == 'Dodecahedron':
		l1.append(12)
	elif i == 'Icosahedron':
		l1.append(20)
print(sum(l1))


n = int(input())
figure = []
for i in range(n):
	figure.append(input())
edge = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
count = 0
for f in figure:
	if f in edge:
		count += edge[f]
print(count)


a = int(input())
things = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
sum = 0
for i in range(a):
	b = input()
	sum = sum + things[b[0]]
print(sum)


d = {}
d['T'] = 4
d['C'] = 6
d['O'] = 8
d['D'] = 12
d['I'] = 20
t = 0
for _ in range(int(input())):
	t += d[input()[0]]
print(t)


num = int(input())
arr = []
for i in range(num):
	temp = input()
	arr.append(temp)
count_faces = 0
for i in arr:
	if i == 'Cube':
		count_faces += 6
		continue
	elif i == 'Tetrahedron':
		count_faces += 4
		continue
	elif i == 'Octahedron':
		count_faces += 8
		continue
	elif i == 'Dodecahedron':
		count_faces += 12
		continue
	elif i == 'Icosahedron':
		count_faces += 20
print(count_faces)


Dict = {'Icosahedron': 20, 'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12}
sides = 0
for numb in range(int(input())):
	sides += Dict[input()]
print(sides)


geo = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
c = 0
for i in range(n):
	c += geo[input()]
print(c)


figury = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
wynik = 0
for x in range(int(input())):
	wynik += figury[input()]
print(wynik)


n = int(input())

def shape(n):
	faces = 0
	for x in range(n):
		shape = str(input())
		if shape == 'Tetrahedron':
			faces += 4
		elif shape == 'Cube':
			faces += 6
		elif shape == 'Octahedron':
			faces += 8
		elif shape == 'Dodecahedron':
			faces += 12
		else:
			faces += 20
	print(faces)
shape(n)


d = {'Tetr': 4, 'Cube': 6, 'Octa': 8, 'Dode': 12, 'Icos': 20}
n = int(input())
print(sum([d[input()[:4]] for x in range(n)]))


n = int(input())
tetrahedron = 4
cube = 6
octahedron = 8
dodecahedron = 12
icosahedron = 20
ans = 0
for i in range(n):
	shape = input()
	if shape == 'Tetrahedron':
		ans += tetrahedron
	elif shape == 'Cube':
		ans += cube
	elif shape == 'Octahedron':
		ans += octahedron
	elif shape == 'Dodecahedron':
		ans += dodecahedron
	elif shape == 'Icosahedron':
		ans += icosahedron
print(ans)


n = int(input())
faces = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
count = sum((faces[input()] for _ in range(n)))
print(count)


def program(a):
	return hedron[a]
hedron = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
amount = 0
for i in range(n):
	a = input()
	amount += program(a)
print(amount)


res = 0
for i in range(int(input())):
	st = input()
	if st == 'Tetrahedron':
		res += 4
	elif st == 'Cube':
		res += 6
	elif st == 'Octahedron':
		res += 8
	elif st == 'Dodecahedron':
		res += 12
	elif st == 'Icosahedron':
		res += 20
print(res)


gr = 0
a = int(input())
for i in range(a):
	s = str(input())
	if s == 'Icosahedron':
		gr = gr + 20
	if s == 'Cube':
		gr = gr + 6
	if s == 'Tetrahedron':
		gr = gr + 4
	if s == 'Dodecahedron':
		gr = gr + 12
	if s == 'Octahedron':
		gr = gr + 8
print(gr)


n = int(input())
sum = 0
for x in range(n):
	s = input()
	if s == 'Icosahedron':
		sum = sum + 20
	elif s == 'Cube':
		sum = sum + 6
	elif s == 'Octahedron':
		sum = sum + 8
	elif s == 'Tetrahedron':
		sum = sum + 4
	elif s == 'Dodecahedron':
		sum = sum + 12
	else:
		pass
print(sum)


n = int(input())
d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
l = []
while n:
	s = input()
	l.append(s)
	n = n - 1
l = [d[k] for k in l]
print(sum(l))


def main():
	n = int(input())
	shape_faces = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	total_faces = 0
	for i in range(n):
		total_faces += shape_faces[input()]
	print(total_faces)
main()


dict1 = {'Icosahedron': 20, 'Dodecahedron': 12, 'Cube': 6, 'Octahedron': 8, 'Tetrahedron': 4}
sum1 = 0
n = int(input())
for i in range(n):
	str1 = input()
	sum1 += dict1[str1]
print(sum1)


n = int(input())
mydict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
sum = 0
for i in range(n):
	str = input()
	x = int(mydict.get(str))
	sum += x
print(sum)


from collections import defaultdict
d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
ans = 0
for i in range(0, n):
	s = str(input())
	ans += d[s]
print(ans)


dic = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
g = int(input())
num = 0
for _ in range(g):
	n = input()
	num += dic[n]
print(num)


import math
shapes = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
faces = [4, 6, 8, 12, 20]

def AntonandPolyhedrons(s):
	return faces[shapes.index(s)]
res = 0
n = int(input())
for i in range(0, n):
	res += AntonandPolyhedrons(input())
print(res)


n = int(input())
ans = 0
for i in range(n):
	val = input()
	if val == 'Tetrahedron':
		ans += 4
	elif val == 'Cube':
		ans += 6
	elif val == 'Octahedron':
		ans += 8
	elif val == 'Dodecahedron':
		ans += 12
	elif val == 'Icosahedron':
		ans += 20
print(ans)


face = 0
for _ in range(int(input())):
	a = input()
	if a[0] == 'T':
		face += 4
	elif a[0] == 'C':
		face += 6
	elif a[0] == 'O':
		face += 8
	elif a[0] == 'D':
		face += 12
	elif a[0] == 'I':
		face += 20
print(face)


n = int(input())
list1 = []
for i in range(n):
	word = input()
	list1.append(word)
a = list1.count('Tetrahedron')
b = list1.count('Cube')
c = list1.count('Octahedron')
d = list1.count('Dodecahedron')
e = list1.count('Icosahedron')
count = 4 * a + 6 * b + 8 * c + 12 * d + 20 * e
print(count)


import sys

def my_strip(string):
	return string[:-1]
n = int(sys.stdin.readline())
lst1 = list(map(my_strip, sys.stdin.readlines()))

def anton(n, lst):
	shape_dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	total = 0
	for i in range(n):
		total += shape_dict[lst[i]]
	print(total)
anton(n, lst1)


n = int(input())
collection = []
fig = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
num = [4, 6, 8, 12, 20]
summa = 0
for i in range(n):
	collection.append(str(input()))
	for j in range(5):
		if collection[-1] == fig[j]:
			summa += num[j]
print(summa)


dict = {}
dict['Tetrahedron'] = 4
dict['Cube'] = 6
dict['Octahedron'] = 8
dict['Dodecahedron'] = 12
dict['Icosahedron'] = 20
testcases = int(input())
summ = 0
for i in range(testcases):
	summ += dict[input()]
print(summ)


def check(s):
	if s == 'Icosahedron':
		return 20
	elif s == 'Tetrahedron':
		return 4
	elif s == 'Octahedron':
		return 8
	elif s == 'Cube':
		return 6
	elif s == 'Dodecahedron':
		return 12
t = int(input())
p = 0
for _ in range(t):
	s = input()
	p += check(s)
print(p)


d = {'Icosahedron': 20, 'Cube': 6, 'Tetrahedron': 4, 'Dodecahedron': 12, 'Octahedron': 8}
n = int(input())
print(sum([d[input().strip()] for i in range(n)]))


poly = {}
poly['Tetrahedron'] = 4
poly['Cube'] = 6
poly['Octahedron'] = 8
poly['Dodecahedron'] = 12
poly['Icosahedron'] = 20
a = int(input())
ans = 0
for i in range(a):
	x = input()
	ans += poly[x]
print(ans)


def f(s):
	if s == 'Cube':
		return 6
	if s == 'Icosahedron':
		return 20
	if s == 'Tetrahedron':
		return 4
	if s == 'Octahedron':
		return 8
	return 12
c = 0
n = int(input())
for i in range(n):
	c += f(input())
print(c)


a = int(input())
dct = {'Icosahedron': 20, 'Cube': 6, 'Octahedron': 8, 'Tetrahedron': 4, 'Dodecahedron': 12}
res = 0
for i in range(a):
	res += dct[input()]
print(res)


n = int(input())
s = []
for k in range(n):
	string = input()
	if string == 'Icosahedron':
		s.append(20)
	if string == 'Dodecahedron':
		s.append(12)
	if string == 'Octahedron':
		s.append(8)
	if string == 'Cube':
		s.append(6)
	if string == 'Tetrahedron':
		s.append(4)
print(sum(s))


n = int(input())
s = [0, 0, 0, 0, 0]
for i in range(n):
	text = input()
	if text == 'Tetrahedron':
		s[0] += 4
	elif text == 'Cube':
		s[1] += 6
	elif text == 'Octahedron':
		s[2] += 8
	elif text == 'Dodecahedron':
		s[3] += 12
	elif text == 'Icosahedron':
		s[4] += 20
print(sum(s))


np = int(input())
th = 0
cb = 0
ot = 0
dd = 0
ic = 0
for i in range(np):
	respu = input()
	if respu == 'Tetrahedron':
		th = th + 4
	if respu == 'Cube':
		cb = cb + 6
	if respu == 'Octahedron':
		ot = ot + 8
	if respu == 'Dodecahedron':
		dd = dd + 12
	if respu == 'Icosahedron':
		ic = ic + 20
fin = th + cb + ot + dd + ic
print(fin)


from collections import deque, defaultdict, Counter
from sys import stdin, stdout

def inp():
	return int(stdin.readline())

def inlt():
	return list(map(int, stdin.readline().split()))

def insr():
	return list(stdin.readline().strip())

def invr():
	return map(int, stdin.readline().split())

def pr(n):
	stdout.write(str(n) + '\n')
import math

def solve():
	d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	res = 0
	for _ in range(inp()):
		s = input()
		if s in d:
			res += d[s]
	pr(res)
solve()


x = int(input())
i = 0
l = []
while i < x:
	l.append(input())
	i += 1
temp = 0
for j in l:
	if 'Tet' in j:
		temp += 4
	elif 'Cub' in j:
		temp += 6
	elif 'Oct' in j:
		temp += 8
	elif 'Dod' in j:
		temp += 12
	elif 'Icos' in j:
		temp += 20
print(temp)


t = 0
for i in [0] * int(input()):
	m = input()
	if m == 'Tetrahedron':
		t = t + 4
	elif m == 'Cube':
		t = t + 6
	elif m == 'Octahedron':
		t = t + 8
	elif m == 'Dodecahedron':
		t = t + 12
	else:
		t = t + 20
print(t)


a = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
cnt = 0
for _ in range(int(input())):
	k = str(input())
	cnt += a[k]
print(cnt)


n = int(input())
l = [input() for i in range(n)]
polyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
res = 0
for x in l:
	res += polyhedrons[x]
print(res)


values = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
length = int(input())
res = 0
key = [input() for _ in range(length)]
for i in key:
	res = res + values[i]
print(res)


mp = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
n = int(input())
print(sum((mp[s[0]] for s in [str(input()) for i in range(n)])))


x = int(input())
shapes_and_sides = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
sum = 0
while x > 0:
	shape = input()
	sum += shapes_and_sides[shape]
	x -= 1
print(sum)


mas = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
ans = 0
for i in range(int(input())):
	ans += mas.get(input()[0])
print(ans)


n = int(input())
lv = 1
sum = 0
while lv <= n:
	a = input()
	if a == 'Tetrahedron':
		sum = sum + 4
	elif a == 'Cube':
		sum = sum + 6
	elif a == 'Octahedron':
		sum = sum + 8
	elif a == 'Dodecahedron':
		sum = sum + 12
	elif a == 'Icosahedron':
		sum = sum + 20
	lv = lv + 1
print(sum)


from __future__ import division, print_function
from fractions import Fraction
import sys
import os
from io import BytesIO, IOBase
from itertools import *
import bisect
from heapq import *
from math import *
from copy import *
from collections import deque
from collections import Counter as counter
from itertools import combinations as comb
from itertools import permutations as permutate
from bisect import bisect_left as bl
from bisect import bisect_right as br
from bisect import bisect
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from types import GeneratorType

def iterative(f, stack=[]):

	def wrapped_func(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		to = f(*args, **kwargs)
		while True:
			if type(to) is GeneratorType:
				stack.append(to)
				to = next(to)
				continue
			stack.pop()
			if not stack:
				break
			to = stack[-1].send(to)
		return to
	return wrapped_func
mod = 1000000007

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def zerolist(n):
	return [0] * n

def nextline():
	out('\n')

def testcase(t):
	for p in range(t):
		solve()

def printlist(a):
	for p in range(0, len(a)):
		out(str(a[p]) + ' ')

def solve():
	d = {'Icosahedron': 20, 'Cube': 6, 'Tetrahedron': 4, 'Dodecahedron': 12, 'Octahedron': 8}
	n = int(inp())
	s = 0
	for i in range(n):
		t = inp()
		s += d[t]
	print(s)
solve()


from sys import stdin, stdout

def ri():
	return map(int, input().split())
n = int(input())
ans = 0
for i in range(n):
	s = input()
	if s[0] == 'T':
		ans += 4
	elif s[0] == 'C':
		ans += 6
	elif s[0] == 'O':
		ans += 8
	elif s[0] == 'D':
		ans += 12
	elif s[0] == 'I':
		ans += 20
print(ans)


def calc(x):
	switcher = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	return switcher.get(x)
ans = 0
n = int(input())
for i in range(n):
	ans += calc(input())
print(ans)


final = []
for _ in range(int(input())):
	n = input()
	if n == 'Tetrahedron':
		final.append(4)
	elif n == 'Cube':
		final.append(6)
	elif n == 'Octahedron':
		final.append(8)
	elif n == 'Dodecahedron':
		final.append(12)
	else:
		final.append(20)
print(sum(final))


n = int(input())
sum = 0
while n:
	text = input()
	if text == 'Tetrahedron':
		sum += 4
	if text == 'Cube':
		sum += 6
	if text == 'Octahedron':
		sum += 8
	if text == 'Dodecahedron':
		sum += 12
	if text == 'Icosahedron':
		sum += 20
	n -= 1
print(sum)


poly = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
sides = 0
for i in range(n):
	a = input()
	sides += poly[a]
print(sides)


f = [{'name': 'Tetrahedron', 'verge': 4}, {'name': 'Cube', 'verge': 6}, {'name': 'Octahedron', 'verge': 8}, {'name': 'Dodecahedron', 'verge': 12}, {'name': 'Icosahedron', 'verge': 20}]
n = int(input())
k = 0
for i in range(n):
	j = input()
	for m in f:
		if m['name'] == j:
			k += m['verge']
print(k)


import sys
import math
import bisect

def main():
	d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	ans = 0
	for _ in range(int(input())):
		ans += d[input()]
	print(ans)
main()


face = dict(Tetrahedron=4, Cube=6, Octahedron=8, Dodecahedron=12, Icosahedron=20)
n = int(input())
res = sum([face[input()] for x in range(n)])
print(res)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, queue, copy
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def LS():
	return sys.stdin.readline().split()

def S():
	return input()

def main():
	n = I()
	sm = 0
	for _ in range(n):
		s = S()
		if s == 'Tetrahedron':
			sm += 4
		elif s == 'Cube':
			sm += 6
		elif s == 'Octahedron':
			sm += 8
		elif s == 'Dodecahedron':
			sm += 12
		else:
			sm += 20
	return sm
print(main())


n = int(input())
w = 0
for i in range(n):
	v = input()
	if 'Tetrahedron' in v:
		w = w + 4
	if 'Cube' in v:
		w = w + 6
	if 'Octahedron' in v:
		w = w + 8
	if 'Dodecahedron' in v:
		w = w + 12
	if 'Icosahedron' in v:
		w = w + 20
print(w)


n = int(input())
count = 0
for m in range(n):
	name = input()
	if name == 'Tetrahedron':
		count += 4
	elif name == 'Cube':
		count += 6
	elif name == 'Octahedron':
		count += 8
	elif name == 'Dodecahedron':
		count += 12
	else:
		count += 20
print(count)


import sys, os
from io import BytesIO, IOBase
import collections, itertools, bisect, heapq, math, string
BUFSIZE = 8192
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def main():
	n = int(input())
	a = 0
	for i in range(n):
		s = input()
		if s == 'Tetrahedron':
			b = 4
		elif s == 'Cube':
			b = 6
		elif s == 'Octahedron':
			b = 8
		elif s == 'Dodecahedron':
			b = 12
		else:
			b = 20
		a += b
	print(a)
main()


n = int(input())
d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
l = []
f = []
i = 0
while i != n:
	l.append(input())
	f.append(d[l[i]])
	i = i + 1
print(sum(f))


(t, c, o, d, i) = (4, 6, 8, 12, 20)
tot = 0
for _ in range(int(input())):
	k = input()
	if k[0] == 'T':
		tot += t
	elif k[0] == 'C':
		tot += c
	elif k[0] == 'O':
		tot += o
	elif k[0] == 'D':
		tot += d
	else:
		tot += i
print(tot)


def printans(arr):
	summ = 0
	for item in arr:
		if item == 'Tetrahedron':
			summ += 4
		elif item == 'Cube':
			summ += 6
		elif item == 'Octahedron':
			summ += 8
		elif item == 'Dodecahedron':
			summ += 12
		else:
			summ += 20
	print(summ)
testcases = int(input())
arr = []
for _ in range(testcases):
	name = input()
	arr.append(name)
printans(arr)


n = input()
polys = []
faces = 0
for i in range(int(n)):
	s = input()
	polys.append(s)
for i in polys:
	if i == 'Tetrahedron':
		faces += 4
	if i == 'Cube':
		faces += 6
	if i == 'Octahedron':
		faces += 8
	if i == 'Dodecahedron':
		faces += 12
	if i == 'Icosahedron':
		faces += 20
print(faces)


n = int(input())
sh = []
sum = 0
for i in range(0, n):
	s = input()
	sh.append(s)
for j in range(0, n):
	if sh[j] == 'Tetrahedron':
		sum = sum + 4
	elif sh[j] == 'Cube':
		sum = sum + 6
	elif sh[j] == 'Octahedron':
		sum = sum + 8
	elif sh[j] == 'Dodecahedron':
		sum = sum + 12
	elif sh[j] == 'Icosahedron':
		sum = sum + 20
print(sum)


h = int(input())
i = 0
a = 0
b = 0
c = 0
d = 0
e = 0
while i < h:
	n = input()
	if n == 'Tetrahedron':
		a += 4
	elif n == 'Cube':
		b += 6
	elif n == 'Octahedron':
		c += 8
	elif n == 'Dodecahedron':
		d += 12
	elif n == 'Icosahedron':
		e += 20
	i = i + 1
y = a + b
z = c + d
w = e
x = y + z + w
print(x)


c = 0
for _ in range(int(input())):
	s = input()
	s = s.lower()
	if s == 'cube':
		c += 6
	elif s == 'tetrahedron':
		c += 4
	elif s == 'octahedron':
		c += 8
	elif s == 'dodecahedron':
		c += 12
	elif s == 'icosahedron':
		c += 20
print(c)


n = int(input())
ct = 0
t = 'Tetrahedron'
c = 'Cube'
o = 'Octahedron'
d = 'Dodecahedron'
i = 'Icosahedron'
for _ in range(n):
	s = input()
	if s == t:
		ct = ct + 4
	elif s == c:
		ct = ct + 6
	elif s == o:
		ct = ct + 8
	elif s == d:
		ct = ct + 12
	else:
		ct = ct + 20
print(ct)


n = int(input())
hedron = dict()
c = 0
for i in range(0, n):
	s = input()
	if s not in hedron:
		hedron[s] = 1
	else:
		hedron[s] = hedron[s] + 1
for word in hedron:
	if word == 'Tetrahedron':
		c = c + 4 * hedron[word]
	elif word == 'Cube':
		c = c + 6 * hedron[word]
	elif word == 'Octahedron':
		c = c + 8 * hedron[word]
	elif word == 'Dodecahedron':
		c = c + 12 * hedron[word]
	elif word == 'Icosahedron':
		c = c + 20 * hedron[word]
print(c)


import math
dic = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input().strip())
count = 0
for i in range(n):
	name = input().strip()
	count += dic[name]
print(count)


mapa = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
suma = 0
for i in range(int(input())):
	suma += mapa[input()]
print(suma)


n = int(input())
a = []
f = 0
for i in range(n):
	a.append(input())
for i in a:
	if i == 'Icosahedron':
		f += 20
	elif i == 'Cube':
		f += 6
	elif i == 'Tetrahedron':
		f += 4
	elif i == 'Dodecahedron':
		f += 12
	else:
		f += 8
print(f)


from sys import stdin, stdout
faces = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(stdin.readline())
fcs = 0
while n > 0:
	fcs += faces[stdin.readline()[:-1]]
	n -= 1
stdout.write(str(fcs) + '\n')


b = 0
c = 0
d = 0
e = 0
f = 0
res = 0
n = int(input())
for _ in range(n):
	a = input()
	if a == 'Icosahedron':
		b = 20
		res = res + b
	elif a == 'Cube':
		c = 6
		res = res + c
	elif a == 'Tetrahedron':
		d = 4
		res = res + d
	elif a == 'Dodecahedron':
		e = 12
		res = res + e
	elif a == 'Octahedron':
		f = 8
		res = res + f
print(res)


faces = {'Icosahedron': 20, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Tetrahedron': 4}
n = int(input())
s = 0
for i in range(n):
	x = input()
	y = faces[x]
	s += y
print(s)


import sys, queue, string, math
try:
	import dev_act_ffc429465ab634
	DEV = True
except:
	DEV = False

def log(*s):
	if DEV:
		print('LOG', *s)

class EJudge:

	def __init__(self, problem='default', reclim=1 << 30):
		self.problem = problem
		sys.setrecursionlimit(reclim)

	def use_files(self, infile='', outfile=''):
		if infile != '':
			self.infile = open(infile)
			sys.stdin = self.infile
		if infile != '':
			self.outfile = open(outfile, 'w')
			sys.stdout = self.outfile

	def use_bacs_files(self):
		self.use_files(self.problem + '.in', self.problem + '.out')

	def get_tl(self):
		while True:
			pass

	def get_ml(self):
		tmp = [[[5] * 100000 for _ in range(1000)]]
		while True:
			tmp.append([[5] * 100000 for _ in range(1000)])

	def get_re(self):
		s = (0,)[8]

	def get_wa(self, wstr='blablalblah'):
		for _ in range(3):
			print(wstr)
		exit()

class IntReader:

	def __init__(self):
		self.ost = queue.Queue()

	def get(self):
		return int(self.sget())

	def sget(self):
		if self.ost.empty():
			for el in input().split():
				self.ost.put(el)
		return self.ost.get()

	def release(self):
		res = []
		while not self.ost.empty():
			res.append(self.ost.get())
		return res

def tokenized(s):
	word = []
	for ch in s.strip():
		if ch == ' ':
			if word:
				yield ''.join(word)
				word = []
		elif 'a' <= ch <= 'z' or 'A' <= ch <= 'Z' or '0' <= ch <= '9':
			word.append(ch)
		else:
			if word:
				yield ''.join(word)
				word = []
			yield ch
	if word:
		yield ''.join(word)
		word = []
ej = EJudge()
int_reader = IntReader()
fmap = lambda f, *l: list(map(f, *l))
parse_int = lambda : fmap(int, input().split())
fig = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
ans = 0
for _ in range(int(input())):
	ans += fig[input().strip()]
print(ans)


n = int(input())
result = 0
numOfFaces = dict()
numOfFaces['Octahedron'] = 8
numOfFaces['Icosahedron'] = 20
numOfFaces['Dodecahedron'] = 12
numOfFaces['Cube'] = 6
numOfFaces['Tetrahedron'] = 4
for i in range(n):
	obj = str(input())
	result += numOfFaces[obj]
print(result)


n = int(input())
polyhedrons = []
facescounted = 0
for i in range(n):
	polyhedrons.append(input())
for i in range(len(polyhedrons)):
	if polyhedrons[i] == 'Tetrahedron':
		facescounted = facescounted + 4
	elif polyhedrons[i] == 'Cube':
		facescounted = facescounted + 6
	elif polyhedrons[i] == 'Octahedron':
		facescounted = facescounted + 8
	elif polyhedrons[i] == 'Dodecahedron':
		facescounted = facescounted + 12
	elif polyhedrons[i] == 'Icosahedron':
		facescounted = facescounted + 20
print(facescounted)


x = input()
a = int(x)
ans = 0
while a > 0:
	z = input()
	a = a - 1
	if z == 'Tetrahedron':
		ans = ans + 4
	elif z == 'Cube':
		ans = ans + 6
	elif z == 'Octahedron':
		ans = ans + 8
	elif z == 'Dodecahedron':
		ans = ans + 12
	elif z == 'Icosahedron':
		ans = ans + 20
print(ans)


def main():
	n = int(input())
	tf = 0
	for i in range(n):
		name = input()
		if name == 'Tetrahedron':
			tf += 4
			continue
		if name == 'Cube':
			tf += 6
			continue
		if name == 'Octahedron':
			tf += 8
			continue
		if name == 'Dodecahedron':
			tf += 12
			continue
		if name == 'Icosahedron':
			tf += 20
			continue
	print(tf)
main()


ts = int(input())
cnt = 0
while ts > 0:
	st = input()
	if st == 'Tetrahedron':
		cnt += 4
	elif st == 'Cube':
		cnt += 6
	elif st == 'Octahedron':
		cnt += 8
	elif st == 'Dodecahedron':
		cnt += 12
	elif st == 'Icosahedron':
		cnt += 20
	ts -= 1
print(cnt)


n = int(input())
x = []
for a in range(n):
	x.append(str(input()))
print(x.count('Tetrahedron') * 4 + x.count('Cube') * 6 + x.count('Octahedron') * 8 + x.count('Dodecahedron') * 12 + x.count('Icosahedron') * 20)


n = int(input())
face = 0
for i in range(n):
	m = input()
	if m[0] == 'T':
		face = face + 4
	elif m[0] == 'C':
		face = face + 6
	elif m[0] == 'O':
		face = face + 8
	elif m[0] == 'D':
		face = face + 12
	else:
		face = face + 20
print(face)


totalFaces = 0
n = int(input())
for i in range(n):
	polygon = input()
	if polygon == 'Tetrahedron':
		totalFaces += 4
	elif polygon == 'Cube':
		totalFaces += 6
	elif polygon == 'Octahedron':
		totalFaces += 8
	elif polygon == 'Dodecahedron':
		totalFaces += 12
	elif polygon == 'Icosahedron':
		totalFaces += 20
print(totalFaces)


number = int(input())
count = 0
for num in range(number):
	string = str(input())
	if string == 'Tetrahedron':
		count += 4
	if string == 'Cube':
		count += 6
	if string == 'Octahedron':
		count += 8
	if string == 'Dodecahedron':
		count += 12
	if string == 'Icosahedron':
		count += 20
print(count)


dec = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
f = 0
n = int(input())
for i in range(n):
	x = input()
	f += dec[x]
print(f)


cout = int(input())
figures = []
sum = 0
for i in range(cout):
	figures.append(input())
	if figures[i] == 'Tetrahedron':
		sum += 4
	elif figures[i] == 'Cube':
		sum += 6
	elif figures[i] == 'Octahedron':
		sum += 8
	elif figures[i] == 'Dodecahedron':
		sum += 12
	elif figures[i] == 'Icosahedron':
		sum += 20
print(sum)


n = int(input())
mp = dict()
mp['Tetrahedron'] = 4
mp['Cube'] = 6
mp['Octahedron'] = 8
mp['Dodecahedron'] = 12
mp['Icosahedron'] = 20
ans = 0
for i in range(n):
	ans += mp[str(input())]
print(ans)


num = int(input())
polyhedrons = []
total = 0
for i in range(num):
	polyhedrons.append(input())
	if polyhedrons[i] == 'Tetrahedron':
		total += 4
	elif polyhedrons[i] == 'Cube':
		total += 6
	elif polyhedrons[i] == 'Octahedron':
		total += 8
	elif polyhedrons[i] == 'Dodecahedron':
		total += 12
	else:
		total += 20
print(total)


s1 = 0
for t in range(int(input())):
	s = input()
	if s == 'Tetrahedron':
		s1 += 4
	elif s == 'Cube':
		s1 += 6
	elif s == 'Octahedron':
		s1 += 8
	elif s == 'Dodecahedron':
		s1 += 12
	else:
		s1 += 20
print(s1)


n = int(input())
m = 0
k = 0
while m < n:
	s = input()
	if s == 'Tetrahedron':
		k = k + 4
	elif s == 'Cube':
		k = k + 6
	elif s == 'Octahedron':
		k = k + 8
	elif s == 'Dodecahedron':
		k = k + 12
	else:
		k = k + 20
	m = m + 1
print(k)


from math import ceil

def main():
	nums = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	n = int(input())
	s = 0
	for i in range(n):
		s += nums[input()]
	print(s)
main()


P = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
print(sum(list(map(lambda x: P.get(x, 0), [input() for _ in range(int(input()))]))))


grani = 0
n = int(input())
while n > 0:
	stroka = input()
	if stroka == 'Tetrahedron':
		grani = grani + 4
	if stroka == 'Cube':
		grani = grani + 6
	if stroka == 'Octahedron':
		grani = grani + 8
	if stroka == 'Dodecahedron':
		grani = grani + 12
	if stroka == 'Icosahedron':
		grani = grani + 20
	n = n - 1
print(grani)


n = int(input())
polyhedrons = []
for i in range(n):
	polyhedrons.append(input())
mapa_polyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
caras = 0
for polyhedron in polyhedrons:
	caras += mapa_polyhedrons[polyhedron]
print(caras)


T = 4
C = 6
O = 8
D = 12
I = 20
num = int(input())
n = 0
result = 0
while n < num:
	word = input()
	if word == 'Tetrahedron':
		result += T
	elif word == 'Cube':
		result += C
	elif word == 'Octahedron':
		result += O
	elif word == 'Dodecahedron':
		result += D
	elif word == 'Icosahedron':
		result += I
	n += 1
print(result)


import math
import os
import random
import re
import sys
nof = int(input())
myarray = []
for x in range(nof):
	myarray.append(input())

def mainf(n, arr):
	totalsides = 0
	for x in arr:
		if x == 'Icosahedron':
			totalsides += 20
		elif x == 'Cube':
			totalsides += 6
		elif x == 'Tetrahedron':
			totalsides += 4
		elif x == 'Octahedron':
			totalsides += 8
		elif x == 'Dodecahedron':
			totalsides += 12
	print(totalsides)
mainf(nof, myarray)


total_collection = int(input())
total_sides = 0
for i in range(total_collection):
	item = input()
	if item.lower() == 'tetrahedron':
		total_sides += 4
	elif item.lower() == 'cube':
		total_sides += 6
	elif item.lower() == 'octahedron':
		total_sides += 8
	elif item.lower() == 'dodecahedron':
		total_sides += 12
	elif item.lower() == 'icosahedron':
		total_sides += 20
print(total_sides)


import sys
input = sys.stdin.readline
face = 0
for i in range(int(input())):
	s = input().rstrip()
	if s == 'Tetrahedron':
		face += 4
	elif s == 'Cube':
		face += 6
	elif s == 'Octahedron':
		face += 8
	elif s == 'Dodecahedron':
		face += 12
	elif s == 'Icosahedron':
		face += 20
print(face)


n = int(input())
sum = 0
key = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(n):
	tem = input()
	sum += key[tem]
print(sum)


n = int(input())
faces = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
tot = 0
while n > 0:
	s = input().strip()[0]
	tot = tot + faces[s]
	n = n - 1
print(tot)


count = int(input())
total_faces = 0
counts = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(0, count):
	shape = input()
	total_faces += counts[shape]
print(total_faces)


t = int(input())
sum = 0
for i in range(t):
	k = str(input())
	if k == 'Tetrahedron':
		sum = sum + 4
	elif k == 'Cube':
		sum = sum + 6
	elif k == 'Octahedron':
		sum = sum + 8
	elif k == 'Dodecahedron':
		sum = sum + 12
	else:
		sum = sum + 20
print(sum)


n = int(input())
p = []
d = {'Cube': 6, 'Tetrahedron': 4, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
count = 0
j = 0
while j < n:
	p.append(input())
	count += d[p[j]]
	j += 1
print(count)


n = int(input())
(t, c, o, d, I) = (4, 6, 8, 12, 20)
x = 0
for i in range(n):
	polygon = input()
	if polygon.lower() == 'tetrahedron':
		x += t
	elif polygon.lower() == 'cube':
		x += c
	elif polygon.lower() == 'octahedron':
		x += o
	elif polygon.lower() == 'dodecahedron':
		x += d
	elif polygon.lower() == 'icosahedron':
		x += I
print(x)


d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
sm = 0
for i in range(int(input())):
	sr = input()
	sm += d.get(sr)
print(sm)


n = int(input())
face = 0
polys = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
faces = [4, 6, 8, 12, 20]
for i in range(n):
	p = input()
	face += faces[polys.index(p)]
print(face)


tetrahedron = 4
cube = 6
octahedron = 8
dodecahedron = 12
icosahedron = 20
totalSides = 0
figure = ''
polyhedrons = int(input())
for x in range(polyhedrons):
	figure = input()
	if figure == 'Tetrahedron':
		totalSides += 4
	elif figure == 'Cube':
		totalSides += 6
	elif figure == 'Octahedron':
		totalSides += 8
	elif figure == 'Dodecahedron':
		totalSides += 12
	elif figure == 'Icosahedron':
		totalSides += 20
print(totalSides)


cnt = 0
for i in range(int(input())):
	st = str(input())
	if st == 'Tetrahedron':
		cnt = cnt + 4
	if st == 'Cube':
		cnt = cnt + 6
	if st == 'Octahedron':
		cnt = cnt + 8
	if st == 'Dodecahedron':
		cnt = cnt + 12
	if st == 'Icosahedron':
		cnt = cnt + 20
print(cnt)


N = int(input())
c = 0
for i in range(N):
	T = input()
	if T == 'Icosahedron':
		c += 20
	if T == 'Cube':
		c += 6
	if T == 'Tetrahedron':
		c += 4
	if T == 'Octahedron':
		c += 8
	if T == 'Dodecahedron':
		c += 12
print(c)


L = input()
n = int(L)
res = 0
for i in range(n):
	L = input()
	if L == 'Tetrahedron':
		res += 4
	if L == 'Cube':
		res += 6
	if L == 'Octahedron':
		res += 8
	if L == 'Dodecahedron':
		res += 12
	if L == 'Icosahedron':
		res += 20
print(res)


N = int(input())
fs = [input() for x in range(N)]
ans = 0
for f in range(len(fs)):
	if fs[f] == 'Tetrahedron':
		ans += 4
	elif fs[f] == 'Cube':
		ans += 6
	elif fs[f] == 'Octahedron':
		ans += 8
	elif fs[f] == 'Dodecahedron':
		ans += 12
	elif fs[f] == 'Icosahedron':
		ans += 20
print(ans)


a = int(input())
l = []
count = 0
for _ in range(a):
	l.append(input().split())
for i in range(len(l)):
	if l[i] == ['Icosahedron']:
		count += 20
	elif l[i] == ['Cube']:
		count += 6
	elif l[i] == ['Octahedron']:
		count += 8
	elif l[i] == ['Tetrahedron']:
		count += 4
	elif l[i] == ['Dodecahedron']:
		count += 12
print(count)


import sys
input = sys.stdin.readline

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())

def foo():
	n = inp()
	out = 0
	st = []
	for i in range(n):
		st.append(input().split())
	for items in st:
		for item in items:
			if item == 'Tetrahedron':
				out += 4
			elif item == 'Cube':
				out += 6
			elif item == 'Octahedron':
				out += 8
			elif item == 'Dodecahedron':
				out += 12
			elif item == 'Icosahedron':
				out += 20
	return out
print(foo())


m = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
v = 0
for i in range(n):
	x = input()
	v += m[x]
print(v)


faces_per_poly = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}

def main():
	n = int(input())
	nb_faces = 0
	for i in range(n):
		nb_faces += faces_per_poly[input()]
	print(nb_faces, end='')
main()


poly = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
y = []
i = 0
while i < n:
	x = input()
	y.append(x)
	i += 1
k = 0
for ch in y:
	k += poly.get(ch)
print(k)


n = int(input())
shapes = []
for i in range(n):
	shapes.append(input().lower())
face = 0
for shape in shapes:
	if shape == 'tetrahedron':
		face += 4
	elif shape == 'cube':
		face += 6
	elif shape == 'octahedron':
		face += 8
	elif shape == 'dodecahedron':
		face += 12
	elif shape == 'icosahedron':
		face += 20
print(face)


n = int(input())
li = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
lis = [4, 6, 8, 12, 20]
num = 0
for i in range(n):
	x = li.index(input())
	num = num + lis[x]
print(num)


n = int(input())
fig = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
to_print = 0
for _ in range(n):
	to_print += fig[input()]
print(to_print)


figures = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
sum = 0
for k in range(int(input())):
	sum += figures[input()]
print(sum)


s = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
sum = 0
for i in range(int(input())):
	sum += s.get(input()[0])
print(sum)


number_of_polyhedrons = int(input())
total_faces = 0
for x in range(number_of_polyhedrons):
	polyhedron = input().lower()
	if polyhedron == 'tetrahedron':
		total_faces += 4
	elif polyhedron == 'cube':
		total_faces += 6
	elif polyhedron == 'octahedron':
		total_faces += 8
	elif polyhedron == 'dodecahedron':
		total_faces += 12
	elif polyhedron == 'icosahedron':
		total_faces += 20
print(total_faces)


import sys

def input_func():
	num = int(sys.stdin.readline())
	count = 0
	for i in range(0, num):
		word = str(sys.stdin.readline())
		word = word.strip('\n')
		if word == 'Tetrahedron':
			count += 4
		elif word == 'Cube':
			count += 6
		elif word == 'Octahedron':
			count += 8
		elif word == 'Dodecahedron':
			count += 12
		elif word == 'Icosahedron':
			count += 20
		i += 1
	return print(count)
input_func()


n = int(input())
l = [0] * n
x = 0
i = 0
for i in range(n):
	l[i] = input()
for i in range(len(l)):
	if l[i] == 'Tetrahedron':
		x = x + 4
	if l[i] == 'Cube':
		x = x + 6
	if l[i] == 'Octahedron':
		x = x + 8
	if l[i] == 'Dodecahedron':
		x = x + 12
	if l[i] == 'Icosahedron':
		x = x + 20
print(x)


m = int(input())
lst = []
count = 0
for i in range(0, m):
	b = input()
	if b == 'Tetrahedron':
		count = count + 4
	if b == 'Cube':
		count = count + 6
	if b == 'Octahedron':
		count = count + 8
	if b == 'Dodecahedron':
		count = count + 12
	if b == 'Icosahedron':
		count = count + 20
print(count)


d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
r = 0
for _ in range(n):
	r += d[input()]
print(r)


def main():
	amount = int(input())
	list = []
	sum = 0
	for i in range(0, amount):
		figure = input()
		if figure == 'Tetrahedron':
			sum += 4
		elif figure == 'Cube':
			sum += 6
		elif figure == 'Octahedron':
			sum += 8
		elif figure == 'Dodecahedron':
			sum += 12
		elif figure == 'Icosahedron':
			sum += 20
	print(sum)
main()


def main():
	n = int(input())
	dictt = dict()
	dictt['tetra'] = 4
	dictt['cube'] = 6
	dictt['oct'] = 8
	dictt['dod'] = 12
	dictt['ico'] = 20
	test = 0
	for i in range(n):
		ch = input()
		if ch == 'Tetrahedron':
			test = test + dictt['tetra']
		elif ch == 'Cube':
			test = test + dictt['cube']
		elif ch == 'Octahedron':
			test = test + dictt['oct']
		elif ch == 'Dodecahedron':
			test = test + dictt['dod']
		elif ch == 'Icosahedron':
			test = test + dictt['ico']
	print(test)
main()


n = int(input())
cnt = 0
for i in range(n):
	s = str(input())
	if s[0] == 'T':
		cnt += 4
	elif s[0] == 'C':
		cnt += 6
	elif s[0] == 'O':
		cnt += 8
	elif s[0] == 'D':
		cnt += 12
	elif s[0] == 'I':
		cnt += 20
	else:
		print()
print(cnt)


Dict = dict()
Dict['Tetrahedron'] = 4
Dict['Cube'] = 6
Dict['Octahedron'] = 8
Dict['Dodecahedron'] = 12
Dict['Icosahedron'] = 20
n = int(input())
sum = 0
while n > 0:
	n -= 1
	sum += Dict[input()]
print(sum)


nums = input().split(' ')
nums = int(nums[0])
sts = ''
for i in range(nums):
	strs = input()
	sts += strs
ts = sts.count('Tetrahedron')
cu = sts.count('Cube')
oc = sts.count('Octahedron')
do = sts.count('Dodecahedron')
ic = sts.count('Icosahedron')
print(ts * 4 + cu * 6 + oc * 8 + do * 12 + ic * 20)


from sys import stdin
input = stdin.readlines()
lines = [line.rstrip() for line in input]

def main():
	k = int(lines[0])
	aton = lines[1:]
	i = 0
	total = 0
	while i < k:
		if aton[i] == 'Tetrahedron':
			total += 4
		elif aton[i] == 'Cube':
			total += 6
		elif aton[i] == 'Octahedron':
			total += 8
		elif aton[i] == 'Dodecahedron':
			total += 12
		elif aton[i] == 'Icosahedron':
			total += 20
		else:
			break
		i += 1
	print(total)
main()


n = int(input())
print(sum([4 if p == 'Tetrahedron' else 6 if p == 'Cube' else 8 if p == 'Octahedron' else 12 if p == 'Dodecahedron' else 20 for p in [input() for i in range(n)]]))


n = int(input())
c = 0
for i in range(n):
	s = input()
	if s == 'Cube':
		c += 6
		continue
	if s[:5] == 'Tetra':
		c += 4
		continue
	if s[:4] == 'Octa':
		c += 8
		continue
	if s[:6] == 'Dodeca':
		c += 12
		continue
	if s[:5] == 'Icosa':
		c += 20
		continue
print(c)


dic = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
s = [input() for i in range(n)]
t = [dic[x] for x in s]
print(sum(t))


coll_len = int(input())
figs = []
for i in range(coll_len):
	figs.append(input())
polyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
faces = 0
for fig in figs:
	faces += polyhedrons[fig]
print(faces)


x = eval(input())
i = 0
c = 0
while i < x:
	k = str(input())
	if k == 'Tetrahedron':
		c += 4
	elif k == 'Cube':
		c += 6
	elif k == 'Octahedron':
		c += 8
	elif k == 'Dodecahedron':
		c += 12
	elif k == 'Icosahedron':
		c += 20
	i += 1
print(c)


amt = int(input())
amtsur = 0
for i in range(amt):
	xx = input()[0]
	if xx == 'T':
		amtsur = amtsur + 4
	elif xx == 'C':
		amtsur = amtsur + 6
	elif xx == 'O':
		amtsur = amtsur + 8
	elif xx == 'D':
		amtsur = amtsur + 12
	else:
		amtsur = amtsur + 20
print(amtsur)


t = int(input())
poly = 0
for i in range(t):
	a = input()
	if a == 'Tetrahedron':
		poly += 4
		continue
	elif a == 'Cube':
		poly += 6
		continue
	elif a == 'Octahedron':
		poly += 8
		continue
	elif a == 'Dodecahedron':
		poly += 12
		continue
	else:
		poly += 20
		continue
print(poly)


n = int(input())
s = []
for x in range(0, n):
	s.append(input())
c = 0
for y in s:
	if y == 'Tetrahedron':
		c = c + 4
	else:
		continue
for y in s:
	if y == 'Cube':
		c = c + 6
	else:
		continue
for y in s:
	if y == 'Octahedron':
		c = c + 8
	else:
		continue
for y in s:
	if y == 'Dodecahedron':
		c = c + 12
	else:
		continue
for y in s:
	if y == 'Icosahedron':
		c = c + 20
	else:
		continue
print(c)


number = int(input())
names = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
m = []
l = 0
for i in range(number):
	m.append(input())
for i in range(number):
	if m[i] == names[0]:
		l += 4
	elif m[i] == names[1]:
		l += 6
	elif m[i] == names[2]:
		l += 8
	elif m[i] == names[3]:
		l += 12
	elif m[i] == names[4]:
		l += 20
print(l)


def polyhedrons(inputs):
	my_dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	return sum([my_dict[i] for i in inputs])
n = int(input())
print(polyhedrons([str(input()) for i in range(n)]))


face_dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
face_total = 0
for line in range(n):
	face_total += face_dict[input()]
print(face_total)


def solution(list_of_shapes):
	d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	return sum((d[element] for element in list_of_shapes))
number_of_shapes = int(input())
list_of_shapes = []
for _ in range(number_of_shapes):
	list_of_shapes.append(input())
print(solution(list_of_shapes))


def main(lis):
	dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	sum = 0
	for elem in lis:
		sum = sum + dict[elem]
	return sum
try:
	while True:
		test_cases = int(input())
		lis = []
		for i in range(test_cases):
			lis.append(str(input()))
		print(main(lis))
except:
	pass


n = int(input())
mun = 0
for i in range(n):
	b = input()
	if b == 'Tetrahedron':
		c = 4
	if b == 'Cube':
		c = 6
	if b == 'Octahedron':
		c = 8
	if b == 'Dodecahedron':
		c = 12
	if b == 'Icosahedron':
		c = 20
	mun = mun + c
print(mun)


a = int(input())
b = 0
mas = []
for i in range(a):
	c = input()
	mas.append(c)
for j in mas:
	if j == 'Tetrahedron':
		b += 4
	elif j == 'Cube':
		b += 6
	elif j == 'Octahedron':
		b += 8
	elif j == 'Dodecahedron':
		b += 12
	elif j == 'Icosahedron':
		b += 20
print(b)


num = int(input())
out = 0
for i in range(num):
	name = input()
	if name == 'Tetrahedron':
		out += 4
	elif name == 'Cube':
		out += 6
	elif name == 'Octahedron':
		out += 8
	elif name == 'Dodecahedron':
		out += 12
	else:
		out += 20
print(out)


number = input()
values_dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
result = 0
for i in range(int(number)):
	result += values_dict[input()]
print(result)


mapping = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
shapes = int(input())
summing = 0
for i in range(0, shapes):
	summing += mapping[input()]
print(summing)


tetrahedron = 4
cube = 6
Octahedron = 8
Dodecahedron = 12
Icosahedron = 20
TotalFace = 0
noOfPolyhedrons = int(input())
while noOfPolyhedrons > 0:
	polyhedrons = input()
	if polyhedrons == 'Tetrahedron':
		TotalFace += tetrahedron
	elif polyhedrons == 'Cube':
		TotalFace += cube
	elif polyhedrons == 'Octahedron':
		TotalFace += Octahedron
	elif polyhedrons == 'Dodecahedron':
		TotalFace += Dodecahedron
	elif polyhedrons == 'Icosahedron':
		TotalFace += Icosahedron
	noOfPolyhedrons -= 1
print(TotalFace)


d1 = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
s = 0
for _ in range(n):
	st = input()
	s += d1[st]
print(s)


q = int(input())

def f(s):
	if s == 'Tetrahedron':
		return 4
	elif s == 'Cube':
		return 6
	elif s == 'Octahedron':
		return 8
	elif s == 'Dodecahedron':
		return 12
	elif s == 'Icosahedron':
		return 20
d = 0
for i in range(0, q):
	d += f(input())
print(d)


n = int(input())
w = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
faces = 0
for i in range(n):
	faces += w[input()[0]]
print(faces)


(n, cnt) = (int(input()), 0)
polyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(n):
	s = str(input())
	cnt += polyhedrons[s]
print(cnt)


n = int(input())
s = []
for i in range(n):
	str = input()
	s.append(str)
dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
sum = 0
for i in range(len(s)):
	sum = sum + dict.get(s[i])
print(sum)


no_of_lines = int(input())
lines = ''
output = 0
for i in range(no_of_lines):
	lines += input() + ' '
lines = lines.split()
for i in lines:
	if i == 'Icosahedron':
		output += 20
	if i == 'Dodecahedron':
		output += 12
	if i == 'Octahedron':
		output += 8
	if i == 'Cube':
		output += 6
	if i == 'Tetrahedron':
		output += 4
print(output)


size = int(input())
lst = [input() for i in range(size)]
total = 0
for i in lst:
	if i == 'Tetrahedron':
		total += 4
	elif i == 'Cube':
		total += 6
	elif i == 'Octahedron':
		total += 8
	elif i == 'Dodecahedron':
		total += 12
	elif i == 'Icosahedron':
		total += 20
print(total)


output = 0
for c in range(int(input())):
	hydron = input()
	if hydron[0] == 'T':
		output += 4
	elif hydron[0] == 'C':
		output += 6
	elif hydron[0] == 'O':
		output += 8
	elif hydron[0] == 'D':
		output += 12
	elif hydron[0] == 'I':
		output += 20
print(output)


translate = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
x = []
counter = 0
sum_values = 0
while n > counter:
	x.append(input())
	counter += 1
for k in x:
	sum_values += translate[k]
print(sum_values)


n = int(input())
a = []
Tetrahedron = 4
Cube = 6
Octahedron = 8
Dodecahedron = 12
Icosahedron = 20
for i in range(n):
	z = str(input())
	a.append(z)
result = 0
for k in a:
	if k == 'Tetrahedron':
		result += 4
	if k == 'Cube':
		result += 6
	if k == 'Octahedron':
		result += 8
	if k == 'Dodecahedron':
		result += 12
	if k == 'Icosahedron':
		result += 20
print(result)


n = int(input())
k = 0
i = 0
while i != n:
	x = str(input())
	if x == 'Tetrahedron':
		k += 4
	if x == 'Cube':
		k += 6
	if x == 'Octahedron':
		k += 8
	if x == 'Dodecahedron':
		k += 12
	if x == 'Icosahedron':
		k += 20
	i += 1
print(k)


Dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
num_of_shapes = int(input())
total = 0
for x in range(num_of_shapes):
	key = input()
	total += Dict[key]
print(total)


x = int(input())
corn = 0
shapes = [input() for _ in range(x)]
for shape in shapes:
	if shape == 'Tetrahedron':
		corn += 4
	if shape == 'Cube':
		corn += 6
	if shape == 'Octahedron':
		corn += 8
	if shape == 'Dodecahedron':
		corn += 12
	if shape == 'Icosahedron':
		corn += 20
print(corn)


dict1 = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
t = int(input())
ans = 0
for _ in range(t):
	n = input()
	ans += dict1[n]
print(ans)


n = int(input())
arr = []
dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
total = 0
for i in range(n):
	arr.append(input())
for i in arr:
	value = dict.get(i)
	total += value
print(total)


n = int(input())
figures = []
for i in range(0, n):
	a = input()
	figures.append(a)
output = 0
i = 0
while i < n:
	if figures[i] == 'Tetrahedron':
		output = output + 4
	elif figures[i] == 'Cube':
		output = output + 6
	elif figures[i] == 'Octahedron':
		output = output + 8
	elif figures[i] == 'Dodecahedron':
		output = output + 12
	elif figures[i] == 'Icosahedron':
		output = output + 20
	else:
		print('Error!')
	i = i + 1
print(output)


N = int(input())
poly = list()
for i in range(N):
	poly.append(input())
faces = {'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20, 'Tetrahedron': 4}
ans = 0
for i in range(N):
	ans += faces[poly[i]]
print(ans)


n = int(input())
l = ['Tetrahedron', 4, 'Cube', 6, 'Octahedron', 8, 'Dodecahedron', 12, 'Icosahedron', 20]
sum1 = 0
for i in range(n):
	s = input()
	j = l.index(s)
	sum1 += l[j + 1]
print(sum1)


s = 0
d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
t = int(input())
for cases in range(t):
	s += d[input()]
print(s)


n = int(input())
faces = 0
for _ in range(0, n):
	a = {'Cub': 6, 'Ico': 20, 'Tet': 4, 'Oct': 8, 'Dod': 12}
	s = input()
	to_find = s[:3]
	if to_find in a.keys():
		faces = faces + a[to_find]
print(faces)


size = int(input())
arr = []
shapes = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(size):
	x = str(input())
	arr.append(x)
total = 0
for shape in arr:
	total += shapes[shape]
print(total)


import sys
tetrahedron = 4
cube = 6
octahedron = 8
dodecahedron = 12
icosahedron = 20
totalSides = 0
for line in sys.stdin:
	line = line.rstrip()
	if line == 'Tetrahedron':
		totalSides += tetrahedron
	if line == 'Cube':
		totalSides += cube
	if line == 'Octahedron':
		totalSides += octahedron
	if line == 'Dodecahedron':
		totalSides += dodecahedron
	if line == 'Icosahedron':
		totalSides += icosahedron
print(totalSides)


n = int(input())
polys = []
count = 0
for x in range(0, n):
	pol = input().strip()
	if str(pol).endswith('Icosahedron'):
		count += 20
	elif str(pol).endswith('Tetrahedron'):
		count += 4
	elif str(pol).endswith('Cube'):
		count += 6
	elif str(pol).endswith('Octahedron'):
		count += 8
	elif str(pol).endswith('Dodecahedron'):
		count += 12
print(count)


def main():
	n = int(input())
	lista = []
	cont = 0
	for i in range(n):
		lista.append(input())
	diccionario = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	for j in range(n):
		for (key, value) in diccionario.items():
			if key == lista[j]:
				cont = cont + value
				break
	print(cont)
main()


r = 0
for i in range(int(input())):
	a = input()
	b = a[0].lower()
	if b == 't':
		r += 4
	elif b == 'c':
		r += 6
	elif b == 'o':
		r += 8
	elif b == 'd':
		r += 12
	else:
		r += 20
print(r)


from math import *
from copy import *
from string import *
from random import *
from sys import stdin
from sys import maxsize
from operator import *
from itertools import *
from collections import Counter
import math
n = int(input())
c = 0
for i in range(n):
	s = input()
	if s == 'Tetrahedron':
		c = c + 4
	elif s == 'Cube':
		c = c + 6
	elif s == 'Octahedron':
		c += 8
	elif s == 'Dodecahedron':
		c += 12
	else:
		c += 20
print(c)


x = int(input())
z = 0
total = 0
while z < x:
	n = input()
	if n == 'Icosahedron':
		total += 20
	elif n == 'Cube':
		total += 6
	elif n == 'Tetrahedron':
		total += 4
	elif n == 'Dodecahedron':
		total += 12
	else:
		total += 8
	z += 1
print(total)


n = int(input())
lst = []
for i in range(n):
	s = input()
	lst.append(s)
print(lst.count('Tetrahedron') * 4 + lst.count('Cube') * 6 + lst.count('Octahedron') * 8 + lst.count('Dodecahedron') * 12 + lst.count('Icosahedron') * 20)


n = input()
count = 0
a = 'Tetrahedron'
u = []
for x in range(int(n)):
	s = input()
	u.append(s)
for z in u:
	if z == a:
		count += 4
	elif z == 'Cube':
		count += 6
	elif z == 'Octahedron':
		count += 8
	elif z == 'Dodecahedron':
		count += 12
	else:
		count += 20
print(count)


n = int(input())
i = 0
lst = []
while i != n:
	a = input()
	lst.append(a)
	i += 1
print(lst.count('Tetrahedron') * 4 + lst.count('Cube') * 6 + lst.count('Octahedron') * 8 + lst.count('Dodecahedron') * 12 + lst.count('Icosahedron') * 20)


tetrahedron = 'Tetrahedron'
cube = 'Cube'
octahedron = 'Octahedron'
dodecahedron = 'Dodecahedron'
icosahedron = 'Icosahedron'
n = int(input())
a = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
res = 0
for i in range(n):
	res += a.get(input())
print(res)


polyhedrons_dic = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
num = int(input())
polyhedrons = []
while num:
	polyhedrons.append(input())
	num -= 1
summ = 0
for polyhedron in polyhedrons:
	summ += polyhedrons_dic[polyhedron]
print(summ)


c = dict(T=4, C=6, O=8, D=12, I=20)
n = int(input())
k = 0
for i in range(n):
	s = input()
	k += c[s[0]]
print(k)


def calculate_size(sides):
	if sides == 'Icosahedron':
		return 20
	if sides == 'Cube':
		return 6
	if sides == 'Tetrahedron':
		return 4
	if sides == 'Octahedron':
		return 8
	if sides == 'Dodecahedron':
		return 12
	else:
		return 0
num = 0
n = int(input())
for i in range(n):
	sides = input()
	num += calculate_size(sides)
print(num)


list = []
y = input()
y = int(y)
while y > 0:
	list.append(input())
	y = y - 1
Icosahedron = list.count('Icosahedron')
Cube = list.count('Cube')
Tetrahedron = list.count('Tetrahedron')
Dodecahedron = list.count('Dodecahedron')
Octahedron = list.count('Octahedron')
print(Icosahedron * 20 + Cube * 6 + Tetrahedron * 4 + Dodecahedron * 12 + Octahedron * 8)


t = int(input())
count = 0
while t:
	t = t - 1
	s = input()
	if s == 'Tetrahedron':
		count = count + 4
	elif s == 'Cube':
		count = count + 6
	elif s == 'Octahedron':
		count = count + 8
	elif s == 'Dodecahedron':
		count = count + 12
	elif s == 'Icosahedron':
		count = count + 20
	else:
		continue
print(count)


n = int(input())
m = {'I': 20, 'D': 12, 'O': 8, 'C': 6, 'T': 4}
cnt = 0
for i in range(n):
	for ch in input():
		cnt += m[ch]
		break
print(cnt)


n = int(input())
count = 0
while n > 0:
	Name = str(input())
	if Name == 'Tetrahedron':
		count += 4
	if Name == 'Cube':
		count += 6
	if Name == 'Octahedron':
		count += 8
	if Name == 'Dodecahedron':
		count += 12
	if Name == 'Icosahedron':
		count += 20
	n -= 1
print(count)


change = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
res = 0
while n > 0:
	res += change.get(input())
	n -= 1
print(res)


faces = 0
for _ in range(int(input())):
	polygon = input()
	if polygon == 'Cube':
		faces += 6
	elif polygon == 'Icosahedron':
		faces += 20
	elif polygon == 'Tetrahedron':
		faces += 4
	elif polygon == 'Octahedron':
		faces += 8
	else:
		faces += 12
print(faces)


q = int(input())
w = 0
a = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(0, q):
	z = str(input())
	s = a[z]
	w += s
print(w)


final = 0
i = int(input())
for o in range(i):
	o = input()
	if o == 'Tetrahedron':
		final += 4
	elif o == 'Cube':
		final += 6
	elif o == 'Octahedron':
		final += 8
	elif o == 'Dodecahedron':
		final += 12
	elif o == 'Icosahedron':
		final += 20
print(final)


from sys import stdin, stdout
faces = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
total_faces = 0
lines = stdin.read().split('\n')
n = int(lines[0])
for i in range(1, n + 1):
	total_faces += faces[lines[i]]
stdout.write(str(total_faces) + '\n')


shape_dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
cnt = int(input())
faces = 0
for _ in range(cnt):
	x = input()
	faces += shape_dict.get(x)
print(faces)


m = int(input())
c = 0
while m:
	s = input()
	if s == 'Tetrahedron':
		c += 4
	elif s == 'Cube':
		c += 6
	elif s == 'Octahedron':
		c += 8
	elif s == 'Dodecahedron':
		c += 12
	elif s == 'Icosahedron':
		c += 20
	m -= 1
print(c)


num = int(input())
result = 0
for i in range(num):
	word = input()
	if word == 'Tetrahedron':
		result = result + 4
	elif word == 'Cube':
		result = result + 6
	elif word == 'Octahedron':
		result = result + 8
	elif word == 'Dodecahedron':
		result = result + 12
	else:
		result = result + 20
print(result)


n = int(input())
e = []
result = 0
for i in range(n):
	e.append(input())
for x in e:
	if x == 'Tetrahedron':
		result += 4
	elif x == 'Cube':
		result += 6
	elif x == 'Octahedron':
		result += 8
	elif x == 'Dodecahedron':
		result += 12
	elif x == 'Icosahedron':
		result += 20
print(result)


def f(s):
	if s == 'Tetrahedron':
		return 4
	elif s == 'Cube':
		return 6
	elif s == 'Octahedron':
		return 8
	elif s == 'Dodecahedron':
		return 12
	elif s == 'Icosahedron':
		return 20
	else:
		return 0
print(sum([f(input()) for _ in range(int(input()))]))


n = int(input())
sides = 0
while n:
	poly = input()
	if poly == 'Tetrahedron':
		sides += 4
	elif poly == 'Cube':
		sides += 6
	elif poly == 'Octahedron':
		sides += 8
	elif poly == 'Dodecahedron':
		sides += 12
	elif poly == 'Icosahedron':
		sides += 20
	n -= 1
print(sides)


t = int(input())
count = 0
dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
while t != 0:
	str = input()
	count += dict[str]
	t -= 1
print(count)


dicionario = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
x = int(input())
res = 0
for i in range(x):
	poly = input()
	for polygon in dicionario:
		if poly == polygon:
			res += dicionario[polygon]
print(res)


def cal_faces(poly):
	if poly == 'Tetrahedron':
		return 4
	if poly == 'Cube':
		return 6
	if poly == 'Octahedron':
		return 8
	if poly == 'Dodecahedron':
		return 12
	if poly == 'Icosahedron':
		return 20
n = int(input())
faces = 0
while n != 0:
	poly = str(input())
	faces += cal_faces(poly)
	n = n - 1
print(faces)


from sys import stdin as inp
from sys import stdout as out
d = dict()
d['Tetrahedron'] = 4
d['Cube'] = 6
d['Octahedron'] = 8
d['Dodecahedron'] = 12
d['Icosahedron'] = 20
s = 0
for _ in range(int(input())):
	s += d[input()]
print(s)


from sys import exit as sys_return
figure_dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
(amount, total) = (int(input()), 0)
for i in range(amount):
	total += figure_dict[str(input())]
print(total)


d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
inp = int(input())
l = []
x = 0
for num in range(inp):
	inp = input()
	l.append(inp)
for words in l:
	x += d[words]
print(x)


import sys

def main():
	poly = {'Icosahedron': 20, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Tetrahedron': 4}
	n = int(sys.stdin.readline().strip())
	faces = 0
	for i in range(n):
		shape = sys.stdin.readline().strip()
		faces += poly[shape]
	print(faces)
main()


import sys
n = int(sys.stdin.readline())
b = 0
for i in range(n):
	a = sys.stdin.readline()
	if a.startswith('T'):
		b += 4
	elif a.startswith('C'):
		b += 6
	elif a.startswith('O'):
		b += 8
	elif a.startswith('D'):
		b += 12
	elif a.startswith('I'):
		b += 20
print(b)


num = int(input())
shapes = []
for i in range(num):
	shapes.append(input())
faces = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
total = 0
for shape in shapes:
	total += faces.get(shape)
print(total)


number = int(input())
soma = 0
while number != 0:
	polyhedro = input()
	if polyhedro == 'Tetrahedron':
		soma += 4
	if polyhedro == 'Cube':
		soma += 6
	if polyhedro == 'Octahedron':
		soma += 8
	if polyhedro == 'Dodecahedron':
		soma += 12
	if polyhedro == 'Icosahedron':
		soma += 20
	number -= 1
print(soma)


n = int(input())
ret = 0
convert = {'Icosahedron': 20, 'Dodecahedron': 12, 'Octahedron': 8, 'Cube': 6, 'Tetrahedron': 4}
for i in range(n):
	ret += convert[input()]
print(ret)


z = 0
for i in range(int(input())):
	a = input()
	if a == 'Icosahedron':
		z += 20
	elif a == 'Tetrahedron':
		z += 4
	elif a == 'Cube':
		z += 6
	elif a == 'Octahedron':
		z += 8
	elif a[0] == 'D':
		z += 12
print(z)


n = int(input())
d = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
total = 0
for i in range(n):
	a = input().strip()
	total += d[a[0]]
print(total)


n = int(input())
D = dict()
s = 0
D['Tetrahedron'] = 4
D['Cube'] = 6
D['Octahedron'] = 8
D['Dodecahedron'] = 12
D['Icosahedron'] = 20
for i in range(n):
	ch = input()
	s = s + D[ch]
print(s)


n = int(input())
side = 0
for i in range(n):
	shape = input()
	if shape[0] == 'C':
		side += 6
	elif shape[0] == 'T':
		side += 4
	elif shape[0] == 'O':
		side += 8
	elif shape[0] == 'D':
		side += 12
	else:
		side += 20
print(side)


n = int(input())
shapes = []
while n > 0:
	s = input()
	shapes.append(s)
	n -= 1
count = 0
for i in shapes:
	if i == 'Tetrahedron':
		count = count + 4
	elif i == 'Cube':
		count = count + 6
	elif i == 'Octahedron':
		count = count + 8
	elif i == 'Dodecahedron':
		count = count + 12
	else:
		count = count + 20
print(count)


import math
import sys
import string

def ri():
	return input()

def ii():
	return int(input())

def li():
	return input().split()

def mi():
	return list(map(int, input().split()))
n = ii()
c = 0
for i in range(n):
	s = ri()
	if s == 'Tetrahedron':
		c += 4
	elif s == 'Cube':
		c += 6
	elif s == 'Octahedron':
		c += 8
	elif s == 'Dodecahedron':
		c += 12
	else:
		c += 20
print(c)


def Polyhedron(n, s):
	sum = 0
	shapes = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	for i in range(n):
		sum = sum + shapes[s[i]]
	return sum
x = int(input())
s = []
for i in range(x):
	i = input()
	s.append(i)
print(Polyhedron(x, s))


d = {'Icosahedron': 20, 'Cube': 6, 'Tetrahedron': 4, 'Dodecahedron': 12, 'Octahedron': 8}
n = int(input())
lst = []
for i in range(n):
	lst.append(input())
c = 0
for i in lst:
	c += d[i]
print(c)


faces = {'Cube': 6, 'Tetrahedron': 4, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
l = []
while n:
	l.append(input())
	n -= 1
sums = 0
for i in l:
	if i in faces:
		sums += faces[i]
print(sums)


import sys
forms = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}

def solve():
	x = int(input())
	i = x
	result = 0
	while i > 0:
		result += forms[str(input())]
		i = i - 1
	return result
print(solve())


n = int(input())
hv = []
for i in range(n):
	h = input()
	d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	for (k, v) in d.items():
		if k == h:
			hv.append(v)
print(sum(hv))


import sys

def gets():
	return sys.stdin.readline().strip()

def get():
	return int(sys.stdin.readline().strip())
d = {'Tetrahedron': 4, 'Dodecahedron': 12, 'Cube': 6, 'Octahedron': 8, 'Icosahedron': 20}
s = 0
for _ in range(get()):
	s += d[gets()]
print(s)


n = int(input())
ans = 0
for _ in range(n):
	c = input()
	if c == 'Icosahedron':
		ans += 20
	elif c == 'Cube':
		ans += 6
	elif c == 'Octahedron':
		ans += 8
	elif c == 'Dodecahedron':
		ans += 12
	else:
		ans += 4
print(ans)


import sys
from collections import defaultdict
shapes = defaultdict(int)
n = int(sys.stdin.readline())
for shape in range(n):
	name = sys.stdin.readline()[:-1]
	shapes[name] += 1
total = 0
total += 4 * shapes['Tetrahedron']
total += 6 * shapes['Cube']
total += 8 * shapes['Octahedron']
total += 12 * shapes['Dodecahedron']
total += 20 * shapes['Icosahedron']
print(total)


def solve():
	figures = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	n = int(input())
	counter = 0
	for i in range(n):
		counter += figures.get(input(), 0)
	print(counter)
solve()


import sys
n = int(input())
d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
ans = 0
for i in range(n):
	name = input()
	ans += d[name]
print(ans)


n = int(input())
c = 0
e = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
q = [4, 6, 8, 12, 20]
for i in range(n):
	a = input()
	c += q[e.index(a)]
print(c)


import math
import collections
import bisect
import heapq
import time
import random
import itertools
import sys
faces = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
N = int(input())
ans = 0
for i in range(N):
	s = input()
	ans += faces[s]
print(ans)


n = int(input())
n_faces = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
cont = 0
for _ in range(n):
	poly = input()
	cont += n_faces[poly]
print(cont)


h = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input().strip())
hedres = 0
for _ in range(n):
	die = input().strip()
	hedres += h[die]
print(hedres)


s = 0
for _ in range(int(input())):
	sh = input()[0]
	s += 4 if sh == 'T' else 6 if sh == 'C' else 8 if sh == 'O' else 12 if sh == 'D' else 20
print(s)


l = []
count = 0
n = int(input())
for i in range(n):
	l.append(input())
for j in range(len(l)):
	if l[j] == 'Cube':
		count = count + 6
	if l[j] == 'Octahedron':
		count = count + 8
	if l[j] == 'Dodecahedron':
		count = count + 12
	if l[j] == 'Icosahedron':
		count = count + 20
	if l[j] == 'Tetrahedron':
		count = count + 4
	else:
		continue
print(count, end='')


n = int(input())
ans = 0

def f(x):
	if x == 'Tetrahedron':
		return 4
	elif x == 'Cube':
		return 6
	elif x == 'Octahedron':
		return 8
	elif x == 'Dodecahedron':
		return 12
	else:
		return 20
for i in range(n):
	s = input()
	ans += f(s)
print(ans)


g = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Icosahedron': 20, 'Dodecahedron': 12}
t = int(input())
print(sum([g[input()] for e in range(0, t)]))


import sys
n = int(sys.stdin.readline().rstrip())
count = 0
for polygon in map(str.rstrip, sys.stdin):
	if polygon == 'Tetrahedron':
		count += 4
	elif polygon == 'Cube':
		count += 6
	elif polygon == 'Octahedron':
		count += 8
	elif polygon == 'Dodecahedron':
		count += 12
	else:
		count += 20
print(str(count) + '\n')


dict1 = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
count1 = 0
for i in range(n):
	line = input()
	count1 += dict1[line]
print(count1)


poly = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}

def shape(polyhedrons):
	no_of_sides = 0
	for polyhedron in polyhedrons:
		no_of_sides += poly[polyhedron]
	return no_of_sides
t = int(input())
polyhedrons = list()
for _ in range(t):
	size = input()
	polyhedrons.append(size)
print(shape(polyhedrons))


n = int(input())
l = [input() for i in range(n)]
sum1 = 0
for i in l:
	if i == 'Tetrahedron':
		sum1 += 4
	elif i == 'Cube':
		sum1 += 6
	elif i == 'Octahedron':
		sum1 += 8
	elif i == 'Dodecahedron':
		sum1 += 12
	else:
		sum1 += 20
print(sum1)


def polydromes(number, names_array):
	sides = 0
	for name in names_array:
		if name == 'Tetrahedron':
			sides += 4
		if name == 'Cube':
			sides += 6
		if name == 'Octahedron':
			sides += 8
		if name == 'Dodecahedron':
			sides += 12
		if name == 'Icosahedron':
			sides += 20
	return sides
4
n = input()
input_array = []
for index in range(0, int(n)):
	input_array.append(input())
print(polydromes(n, input_array))


n = int(input())
summ = 0
while n != 0:
	z = input()
	if z == 'Tetrahedron':
		summ = summ + 4
	if z == 'Cube':
		summ = summ + 6
	if z == 'Octahedron':
		summ = summ + 8
	if z == 'Dodecahedron':
		summ = summ + 12
	if z == 'Icosahedron':
		summ = summ + 20
	n = n - 1
print(summ)


def Anton(n, A):
	shapes = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	faces = 0
	for i in range(n):
		faces += shapes[A[i]]
	return faces
n = int(input())
A = []
for i in range(n):
	A.append(input())
print(Anton(n, A))


t = 'Tetrahedron'
c = 'Cube'
o = 'Octahedron'
d = 'Dodecahedron'
i = 'Icosahedron'
g = int(input())
num = 0
for _ in range(g):
	n = input()
	if n == t:
		num += 4
	elif n == c:
		num += 6
	elif n == o:
		num += 8
	elif n == d:
		num += 12
	elif n == i:
		num += 20
print(num)


d = {'Icosahedron': 20, 'Cube': 6, 'Tetrahedron': 4, 'Dodecahedron': 12, 'Octahedron': 8}
x = int(input())
total = 0
for i in range(x):
	total += d[str(input())]
print(total)


x = int(input())
Tetrahedron = 4
Cube = 6
Octahedron = 8
Dodecahedron = 12
Icosahedron = 20
y = 0
while x > 0:
	z = input()
	if z == 'Tetrahedron':
		y += 4
	elif z == 'Cube':
		y += 6
	elif z == 'Octahedron':
		y += 8
	elif z == 'Dodecahedron':
		y += 12
	elif z == 'Icosahedron':
		y += 20
	else:
		pass
	x -= 1
print(y)


x = int(input())
cnt = 0
for i in range(x):
	elem = input()
	if elem == 'Tetrahedron':
		cnt += 4
	elif elem == 'Cube':
		cnt += 6
	elif elem == 'Octahedron':
		cnt += 8
	elif elem == 'Dodecahedron':
		cnt += 12
	elif elem == 'Icosahedron':
		cnt += 20
print(cnt)


def solution(a):
	if a == 'Tetrahedron':
		return 4
	elif a == 'Cube':
		return 6
	elif a == 'Octahedron':
		return 8
	elif a == 'Dodecahedron':
		return 12
	elif a == 'Icosahedron':
		return 20
c = 0
for i in range(int(input())):
	s = solution(input())
	c += s
print(c)


def anton(l):
	d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	return sum([d[shape] for shape in l])
data = input()
n = int(data)
l = []
for i in range(n):
	l.append(input())
print(anton(l))


inp = int(input())
si = 0
for i in range(inp):
	st = input()
	if st == 'Tetrahedron':
		si = si + 4
	elif st == 'Cube':
		si = si + 6
	elif st == 'Octahedron':
		si = si + 8
	elif st == 'Dodecahedron':
		si = si + 12
	else:
		si = si + 20
print(si)


n = int(input())
sequence = [input() for i in ' ' * n]
dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
sum = 0
for figure in sequence:
	sum += dict[figure]
print(sum)


Tetrahedron = 4
Cube = 6
Octahedron = 8
Dodecahedron = 12
Icosahedron = 20

def main():
	ans = 0
	n = int(input())
	for _ in range(n):
		s = str(input())
		if s == 'Tetrahedron':
			ans += 4
		if s == 'Cube':
			ans += 6
		if s == 'Octahedron':
			ans += 8
		if s == 'Dodecahedron':
			ans += 12
		if s == 'Icosahedron':
			ans += 20
	return ans
print(main())


print(sum(map(lambda x: {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}[x], (input() for _ in range(int(input()))))))


numberOfPolyhedron = input('')
currentFaces = 0
for polyhedron in range(int(numberOfPolyhedron)):
	shape = input('')
	if shape == 'Tetrahedron':
		currentFaces = currentFaces + 4
	elif shape == 'Cube':
		currentFaces = currentFaces + 6
	elif shape == 'Octahedron':
		currentFaces = currentFaces + 8
	elif shape == 'Dodecahedron':
		currentFaces = currentFaces + 12
	elif shape == 'Icosahedron':
		currentFaces = currentFaces + 20
print(currentFaces)


import math, sys, itertools

def main():
	d = {'Icosahedron': 20, 'Cube': 6, 'Tetrahedron': 4, 'Dodecahedron': 12, 'Octahedron': 8}
	n = int(input())
	ans = 0
	for i in range(n):
		ans += d[input()]
	print(ans)
main()


num = int(input())
faces = 0
while num:
	polyhedron = input()
	if polyhedron == 'Tetrahedron':
		faces += 4
	elif polyhedron == 'Cube':
		faces += 6
	elif polyhedron == 'Octahedron':
		faces += 8
	elif polyhedron == 'Dodecahedron':
		faces += 12
	else:
		faces += 20
	num -= 1
print(faces)


n = int(input())
array = []
ans = 0
for i in range(n):
	shape = input()
	array.append(shape)
for i in array:
	if i == 'Tetrahedron':
		ans += 4
	elif i == 'Cube':
		ans += 6
	elif i == 'Octahedron':
		ans += 8
	elif i == 'Dodecahedron':
		ans += 12
	elif i == 'Icosahedron':
		ans += 20
print(ans)


POLYHEDRONS = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
number = int(input())
print(sum((POLYHEDRONS[hedron] for hedron in (input() for _ in range(number)))))


d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
s = 0
n = int(input())
for _ in range(n):
	string = input()
	s += d.get(string)
print(s)


n = int(input())
side = 0
for i in range(n):
	shape = input()
	if shape == 'Cube':
		side += 6
	elif shape == 'Tetrahedron':
		side += 4
	elif shape == 'Octahedron':
		side += 8
	elif shape == 'Dodecahedron':
		side += 12
	else:
		side += 20
print(side)


n = int(input())
s = []
sum = 0
for i in range(1, n + 1):
	str = input()
	s.append(str)
for i in s:
	if i == 'Icosahedron':
		sum = sum + 20
	elif i == 'Dodecahedron':
		sum = sum + 12
	elif i == 'Octahedron':
		sum = sum + 8
	elif i == 'Cube':
		sum = sum + 6
	else:
		sum = sum + 4
print(sum)


w = int(input())
a = []
for i in range(0, w):
	p = input()
	a.append(p)
c = 0
for i in range(0, w):
	if a[i] == 'Tetrahedron':
		c = c + 4
	elif a[i] == 'Cube':
		c = c + 6
	elif a[i] == 'Octahedron':
		c = c + 8
	elif a[i] == 'Dodecahedron':
		c = c + 12
	elif a[i] == 'Icosahedron':
		c = c + 20
print(c)


n = int(input())
l = []
for i in range(n):
	l.append(input())
tet = l.count('Tetrahedron') * 4
cube = l.count('Cube') * 6
octa = l.count('Octahedron') * 8
dod = l.count('Dodecahedron') * 12
ico = l.count('Icosahedron') * 20
print(tet + cube + octa + dod + ico)


countFigures = int(input())
dictFigures = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
sumGranes = 0
for _ in range(countFigures):
	figure = input()
	sumGranes += dictFigures[figure]
print(sumGranes)


polygons = {'tetrahedron': 4, 'cube': 6, 'octahedron': 8, 'dodecahedron': 12, 'icosahedron': 20}
n = int(input())
s = 0
for _ in range(n):
	name = input()
	s += polygons[name.lower()]
print(s, end='')


no = int(input())
polygon_lib = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
faces = 0
for i in range(no):
	polygon = input()
	faces += polygon_lib[polygon]
print(faces)


def antonAndPolyhedron(n, antonCol):
	polyDict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	totalFaces = 0
	for shape in antonCol:
		totalFaces += polyDict[shape]
	return totalFaces
n = int(input())
antonCol = []
for i in range(n):
	antonCol.append(input())
print(antonAndPolyhedron(n, antonCol))


from sys import stdin, stdout
collection = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
total = 0
n = int(stdin.readline())
for _ in range(n):
	polyhedron = stdin.readline().strip()
	total += collection[polyhedron]
stdout.write('%d\n' % total)


n = int(input())
flag = 0
for i in range(n):
	str1 = input()
	if str1 == 'Icosahedron':
		flag += 20
	elif str1 == 'Cube':
		flag += 6
	elif str1 == 'Tetrahedron':
		flag += 4
	elif str1 == 'Dodecahedron':
		flag += 12
	elif str1 == 'Octahedron':
		flag += 8
print(flag)


n = int(input())
ans = 0
while n > 0:
	n -= 1
	s = input()
	if s[0] == 'T':
		ans += 4
	elif s[0] == 'C':
		ans += 6
	elif s[0] == 'O':
		ans += 8
	elif s[0] == 'D':
		ans += 12
	else:
		ans += 20
print(ans)


n = int(input())
tab = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
som = 0
for i in range(n):
	som += tab[input()]
print(str(som))


n = int(input())
lst = []
for i in range(n):
	p = input()
	p = p.lower()
	lst.append(p)
s = 0
for poly in lst:
	if poly == 'tetrahedron':
		s = s + 4
	elif poly == 'cube':
		s = s + 6
	elif poly == 'octahedron':
		s = s + 8
	elif poly == 'dodecahedron':
		s = s + 12
	elif poly == 'icosahedron':
		s = s + 20
	else:
		pass
print(s)


index = int(input())
result = 0
while index > 0:
	word = input()
	if word == 'Tetrahedron':
		n = 4
	if word == 'Cube':
		n = 6
	if word == 'Octahedron':
		n = 8
	if word == 'Dodecahedron':
		n = 12
	if word == 'Icosahedron':
		n = 20
	result = result + n
	index = index - 1
print(result)


dict_shapes = {'Icosahedron': 20, 'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
total = 0
for ____ in range(int(input())):
	total += dict_shapes.get(input())
print(total)


a = int(input())
total = 0
dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(a):
	o = input()
	total += dict[o]
print(total)


n = int(input())

def solves(n):
	sum = 0
	faces = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	for i in range(n):
		s = input()
		for (k, v) in faces.items():
			if s == k:
				sum += v
	return sum
print(solves(n))


def ch(s):
	if s == 'Icosahedron':
		return 20
	elif s == 'Dodecahedron':
		return 12
	elif s == 'Octahedron':
		return 8
	elif s == 'Cube':
		return 6
	elif s == 'Tetrahedron':
		return 4
	else:
		return 0
n = int(input())
sum = 0
for i in range(n):
	s = input()
	sum = sum + ch(s)
print(sum)


this_dict = {'Icosahedron': 20, 'Dodecahedron': 12, 'Octahedron': 8, 'Cube': 6, 'Tetrahedron': 4}
y = list()
n = int(input())
t = 0
for i in range(1, n + 1):
	ai = input()
	t = t + this_dict[ai]
print(t)


a = int(input())
poly = []
for i in range(a):
	vnes = input()
	poly.append(vnes[0])
total = 0
for i in poly:
	if i == 'T':
		total += 4
	elif i == 'C':
		total += 6
	elif i == 'O':
		total += 8
	elif i == 'D':
		total += 12
	elif i == 'I':
		total += 20
print(total)


from sys import stdin
polyDict = {'Icosahedron': 20, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Tetrahedron': 4}
array = []
for line in stdin:
	array.append(line.rstrip())
n = int(array[0])
faces = 0
for string in array[1:]:
	faces += polyDict[string]
print(faces)


n = int(input())
l = []
for _ in range(n):
	l.append(input())
m = 0
for i in l:
	if i == 'Tetrahedron':
		m += 4
	if i == 'Cube':
		m += 6
	if i == 'Octahedron':
		m += 8
	if i == 'Dodecahedron':
		m += 12
	if i == 'Icosahedron':
		m += 20
print(m)


n = int(input())
i = 0
a = []
output = 0
tetrahedron = 'Tetrahedron'
cube = 'Cube'
octahedron = 'Octahedron'
dodecahedron = 'Dodecahedron'
icosahedron = 'Icosahedron'
while i < n:
	a.append(input())
	i += 1
for ngone in a:
	if ngone == tetrahedron:
		output += 4
	elif ngone == cube:
		output += 6
	elif ngone == octahedron:
		output += 8
	elif ngone == dodecahedron:
		output += 12
	elif ngone == icosahedron:
		output += 20
print(output)


__author__ = 'zihaozhu'
from sys import stdin
cases = int(stdin.readline())
total = 0
for i in range(cases):
	shape = stdin.readline().rstrip()
	if shape == 'Tetrahedron':
		total += 4
	elif shape == 'Cube':
		total += 6
	elif shape == 'Octahedron':
		total += 8
	elif shape == 'Dodecahedron':
		total += 12
	elif shape == 'Icosahedron':
		total += 20
print(total)


n = int(input())
sum_gran = 0
dict_figur = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for _ in range(n):
	sum_gran += dict_figur[input()]
print(sum_gran)


import math

def get_num():
	return list(map(int, input().rstrip().split()))

def rotate(my_list, num):
	return my_list[num:] + my_list[:num]

def main():
	num = int(input())
	answer = 0
	for i in range(num):
		string = input().rstrip()
		if string == 'Icosahedron':
			answer += 20
		if string == 'Cube':
			answer += 6
		if string == 'Octahedron':
			answer += 8
		if string == 'Dodecahedron':
			answer += 12
		if string == 'Tetrahedron':
			answer += 4
	print(answer)
main()


n = int(input())
result = 0
for _ in range(n):
	polyhedron = input()
	if polyhedron.startswith('Tetra'):
		result += 4
	elif polyhedron.startswith('Cu'):
		result += 6
	elif polyhedron.startswith('Octa'):
		result += 8
	elif polyhedron.startswith('Dodec'):
		result += 12
	else:
		result += 20
print(result)


import sys
input = sys.stdin.readline

def main():
	face = 0
	n = inp()
	for x in range(n):
		str = instr()
		if str == 'Tetrahedron':
			face += 4
		elif str == 'Cube':
			face += 6
		elif str == 'Octahedron':
			face += 8
		elif str == 'Dodecahedron':
			face += 12
		elif str == 'Icosahedron':
			face += 20
	print(int(face))

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def instr():
	return ''.join(insr())

def insr():
	s = input()
	return list(s[:len(s) - 1])

def invr():
	return map(int, input().split())
main()


n = int(input())
res = 0
for i in range(n):
	a = input()[0]
	if a == 'T':
		res += 4
	elif a == 'C':
		res += 6
	elif a == 'O':
		res += 8
	elif a == 'D':
		res += 12
	else:
		res += 20
print(res)


a = int(input())
c = 0
for i in range(a):
	b = input()[0]
	if b == 'T':
		c += 4
	elif b == 'C':
		c += 6
	elif b == 'O':
		c += 8
	elif b == 'D':
		c += 12
	else:
		c += 20
print(c)


polyCount = int(input())
polyList = []
for i in range(polyCount):
	polyList.append(input())

def countFaces():
	faces = 0
	n = len(polyList)
	for i in range(n):
		if polyList[i] == 'Tetrahedron':
			faces = faces + 4
		if polyList[i] == 'Cube':
			faces = faces + 6
		if polyList[i] == 'Octahedron':
			faces = faces + 8
		if polyList[i] == 'Dodecahedron':
			faces = faces + 12
		if polyList[i] == 'Icosahedron':
			faces = faces + 20
	print(faces)
countFaces()


num = int(input())
s = 0
for x in range(num):
	shape = input()
	if shape[0] == 'T':
		s += 4
	elif shape[0] == 'C':
		s += 6
	elif shape[0] == 'D':
		s += 12
	elif shape[0] == 'O':
		s += 8
	else:
		s += 20
print(s)


n = int(str(input()).strip())
d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
ans = 0
for _ in range(n):
	ans += d[str(input()).strip()]
print(ans)


n = int(input())
sums = []
for i in range(0, n):
	s = input()
	if s == 'Tetrahedron':
		sums.append(4)
	elif s == 'Cube':
		sums.append(6)
	elif s == 'Octahedron':
		sums.append(8)
	elif s == 'Dodecahedron':
		sums.append(12)
	elif s == 'Icosahedron':
		sums.append(20)
temp = 0
for i in range(0, len(sums)):
	temp = temp + sums[i]
print(temp)


n = int(input())
dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
Sum = 0
while n > 0:
	x = input()
	Sum += dict[x]
	n -= 1
print(Sum)


Anzahl = int(input())
Sammlung = []
for i in range(Anzahl):
	Sammlung.append(input())
Seitenzahl = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
Sammlung = [Seitenzahl[i] for i in Sammlung]
print(sum(Sammlung))


n = int(input())
totalCaras = 0
i = 1
while i <= n:
	poliedro = input()
	if poliedro == 'Tetrahedron':
		totalCaras = totalCaras + 4
	if poliedro == 'Cube':
		totalCaras = totalCaras + 6
	if poliedro == 'Octahedron':
		totalCaras = totalCaras + 8
	if poliedro == 'Dodecahedron':
		totalCaras = totalCaras + 12
	if poliedro == 'Icosahedron':
		totalCaras = totalCaras + 20
	i = i + 1
print(totalCaras)


n = int(input())
list_of_figures = list()
for i in range(n):
	list_of_figures.append(input())
num_of_faces = 0
for k in list_of_figures:
	if k == 'Tetrahedron':
		num_of_faces += 4
	if k == 'Cube':
		num_of_faces += 6
	if k == 'Octahedron':
		num_of_faces += 8
	if k == 'Dodecahedron':
		num_of_faces += 12
	if k == 'Icosahedron':
		num_of_faces += 20
print(num_of_faces)


n = int(input())
nl = []
for i in range(n):
	nl.append(input())
pc = 0
for item in nl:
	if item == 'Tetrahedron':
		pc += 4
	elif item == 'Cube':
		pc += 6
	elif item == 'Octahedron':
		pc += 8
	elif item == 'Dodecahedron':
		pc += 12
	elif item == 'Icosahedron':
		pc += 20
print(pc)


a = int(input())
step = 0
result = 0
while step < a:
	b = str(input())
	if b == 'Tetrahedron':
		result = result + 4
	elif b == 'Cube':
		result = result + 6
	elif b == 'Octahedron':
		result = result + 8
	elif b == 'Dodecahedron':
		result = result + 12
	elif b == 'Icosahedron':
		result = result + 20
	step = step + 1
print(result)


def Check(a):
	if s == 'Icosahedron':
		return 20
	elif s == 'Dodecahedron':
		return 12
	elif s == 'Octahedron':
		return 8
	elif s == 'Cube':
		return 6
	else:
		return 4
n = int(input())
face = 0
for i in range(0, n):
	s = input()
	face += Check(s)
print(face)


n = int(input())
PolyDict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
sum = 0
for i in range(n):
	s = input()
	t = PolyDict.get(s)
	sum = sum + t
print(sum)


n = int(input())
scores = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
result = 0
for i in range(n):
	polyhedron = input()
	result += scores.get(polyhedron)
print(result)


def geometric_face(geom):
	if geom == 'Tetrahedron':
		return 4
	elif geom == 'Cube':
		return 6
	elif geom == 'Octahedron':
		return 8
	elif geom == 'Dodecahedron':
		return 12
	elif geom == 'Icosahedron':
		return 20
	return 0
n = input().strip()
n = int(n)
val = 0
for x in range(0, n):
	geom = input().strip()
	val = val + geometric_face(geom)
print(val)


n = int(input())
i = 0
sum = 0
while i < n:
	fig = input()
	fig = fig.lower()
	if fig == 'cube':
		sum += 6
	elif fig == 'tetrahedron':
		sum += 4
	elif fig == 'octahedron':
		sum += 8
	elif fig == 'dodecahedron':
		sum += 12
	elif fig == 'icosahedron':
		sum += 20
	i += 1
print(sum)


n = int(input())
(L1, s) = ([], 0)
for i in range(n):
	ch = input()
	L = [str(i) for i in ch.split()]
	L1.append(L)
for i in L1:
	if i == ['Tetrahedron']:
		s += 4
	elif i == ['Cube']:
		s += 6
	elif i == ['Octahedron']:
		s += 8
	elif i == ['Dodecahedron']:
		s += 12
	elif i == ['Icosahedron']:
		s += 20
print(s)


n = input()
sets = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
result = 0
for _ in range(int(n)):
	word = input()
	result += sets[word]
print(result)


n = int(input())
c = 0
for _ in range(n):
	x = str(input())
	if x == 'Tetrahedron':
		c += 4
	elif x == 'Cube':
		c += 6
	elif x == 'Octahedron':
		c += 8
	elif x == 'Dodecahedron':
		c += 12
	else:
		c += 20
print(c)


n = int(input())
ls = [input()[0].lower() for x in range(n)]
value = {'t': 4, 'c': 6, 'o': 8, 'd': 12, 'i': 20}
sum = 0
for val in ls:
	sum += value[val]
print(sum)


n = int(input())
list_ = []
count = 0
for i in range(n):
	str_ = str(input())
	list_.append(str_)
for item in list_:
	if item == 'Tetrahedron':
		count = count + 4
	elif item == 'Cube':
		count = count + 6
	elif item == 'Octahedron':
		count = count + 8
	elif item == 'Dodecahedron':
		count = count + 12
	elif item == 'Icosahedron':
		count = count + 20
print(count)


n = int(input())
p = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
count = 0
for i in range(n):
	s = input()
	count += p[s[0]]
print(count)


n = int(input())
l = []
for j in range(n):
	l.append(input())
count = 0
for j in l:
	if j == 'Icosahedron':
		count += 20
	elif j == 'Cube':
		count += 6
	elif j == 'Tetrahedron':
		count += 4
	elif j == 'Dodecahedron':
		count += 12
	else:
		count += 8
print(count)


input1 = int(input())
polyhedrons = []
faces = 0
for i in range(input1):
	pol = input()
	polyhedrons.append(pol)
while True:
	for i in polyhedrons:
		if i in polyhedrons:
			if i == 'Tetrahedron':
				faces += 4
			elif i == 'Cube':
				faces += 6
			elif i == 'Octahedron':
				faces += 8
			elif i == 'Dodecahedron':
				faces += 12
			elif i == 'Icosahedron':
				faces += 20
	print(faces)
	break


polyhedrons = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
n_of_sides = [4, 6, 8, 12, 20]
number = int(input(''))
total = 0
for count in range(0, number):
	user_input = input('')
	for count2 in range(0, 5):
		if polyhedrons[count2] == user_input:
			total += n_of_sides[count2]
print(total)


n = int(input())
a = list()
i = 0
for i in range(n):
	a.append(input())
b = a.count('Tetrahedron')
c = a.count('Cube')
d = a.count('Octahedron')
e = a.count('Dodecahedron')
f = a.count('Icosahedron')
print(b * 4 + c * 6 + d * 8 + e * 12 + f * 20)


n = int(input())
dic = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
total_faces = 0
for i in range(1, n + 1, 1):
	str1 = input()
	total_faces += dic.get(str1)
print(total_faces)


class Polyhedrons:

	def __init__(self, name, faces):
		self.name = name
		self.faces = faces
p1 = Polyhedrons('Tetrahedron', 4)
p2 = Polyhedrons('Cube', 6)
p3 = Polyhedrons('Octahedron', 8)
p4 = Polyhedrons('Dodecahedron', 12)
p5 = Polyhedrons('Icosahedron', 20)
sum = 0
n = int(input())
for i in range(n):
	p = str(input())
	if p == p1.name:
		sum = sum + p1.faces
	elif p == p2.name:
		sum = sum + p2.faces
	elif p == p3.name:
		sum = sum + p3.faces
	elif p == p4.name:
		sum = sum + p4.faces
	elif p == p5.name:
		sum = sum + p5.faces
print(sum)


contatore = 0
m = int(input())
for i in range(0, m):
	a = input()
	if a == 'Tetrahedron':
		contatore += 4
	if a == 'Cube':
		contatore += 6
	if a == 'Octahedron':
		contatore += 8
	if a == 'Dodecahedron':
		contatore += 12
	if a == 'Icosahedron':
		contatore += 20
	else:
		pass
print(contatore)


t = int(input())
p = []
for i in range(t):
	r = input()
	p.append(r)
s = 0
for i in range(t):
	if p[i][0] == 'T':
		s += 4
	if p[i][0] == 'C':
		s += 6
	if p[i][0] == 'O':
		s += 8
	if p[i][0] == 'D':
		s += 12
	if p[i][0] == 'I':
		s += 20
print(s)


polyhedrons = int(input())
faces = 0
for x in range(polyhedrons):
	name = input()
	if name == 'Tetrahedron':
		faces += 4
	elif name == 'Cube':
		faces += 6
	elif name == 'Octahedron':
		faces += 8
	elif name == 'Dodecahedron':
		faces += 12
	else:
		faces += 20
print(faces)


import time
import collections

class Time_test:

	def __enter__(self):
		self.enter_time = time.time()

	def __exit__(self, exc_type, exc_val, exc_tb):
		print('Command was executed in', time.time() - self.enter_time)
n = int(input())
counter = 0
for i in range(n):
	ipt = input()
	if ipt == 'Tetrahedron':
		counter += 4
	elif ipt == 'Cube':
		counter += 6
	elif ipt == 'Octahedron':
		counter += 8
	elif ipt == 'Dodecahedron':
		counter += 12
	elif ipt == 'Icosahedron':
		counter += 20
print(counter)


n = []
while True:
	try:
		line = input()
	except EOFError:
		break
	n.append(line)
del n[0]
ls = []
for var in n:
	if var == 'Tetrahedron':
		ls.append(4)
	elif var == 'Cube':
		ls.append(6)
	elif var == 'Octahedron':
		ls.append(8)
	elif var == 'Dodecahedron':
		ls.append(12)
	elif var == 'Icosahedron':
		ls.append(20)
print(sum(ls))


def func(n, list_task):
	target_sum = 0
	dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	for key in dict:
		for i in range(0, n, 1):
			if key == list_task[i]:
				target_sum += dict[key]
	return target_sum

def main():
	n = int(input())
	target_list = []
	for i in range(0, n, 1):
		word = input()
		target_list.append(word)
	var = func(n, target_list)
	print(var)
main()


poly = list(map(int, input().strip().split()))[0]
names = []
for o in range(poly):
	names.append(input())
polystuff = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
polynum = [4, 6, 8, 12, 20]
num = 0
for i in range(poly):
	for j in range(5):
		if names[i] == polystuff[j]:
			num += polynum[j]
print(num)


n = int(input())
dic = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
sum = 0
for _ in range(n):
	val = input()
	sum += dic[val]
print(int(sum))


def count_faces(s, n):
	faces = 0
	for i in range(n):
		if s[i][0] == 'I':
			faces += 20
		elif s[i][0] == 'D':
			faces += 12
		elif s[i][0] == 'O':
			faces += 8
		elif s[i][0] == 'C':
			faces += 6
		elif s[i][0] == 'T':
			faces += 4
	return faces
n = input()
n = int(n)
s = []
for i in range(n):
	s.append(input())
print(count_faces(s, n))


n = int(input())
ans = 0
for k in range(n):
	str = input()
	if str == 'Icosahedron':
		ans += 20
	elif str == 'Dodecahedron':
		ans += 12
	elif str == 'Octahedron':
		ans += 8
	elif str == 'Cube':
		ans += 6
	else:
		ans += 4
print(ans)


n = int(input())
r = 0
for i in range(n):
	t = input()
	if t == 'Tetrahedron':
		r += 4
	elif t == 'Cube':
		r += 6
	elif t == 'Octahedron':
		r += 8
	elif t == 'Dodecahedron':
		r += 12
	else:
		r += 20
print(r)


def mnogogr_cf():
	d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	n = int(input())
	s = 0
	for i in range(n):
		m = input()
		if m == 'Tetrahedron':
			s += 4
		elif m == 'Cube':
			s += 6
		elif m == 'Octahedron':
			s += 8
		elif m == 'Dodecahedron':
			s += 12
		elif m == 'Icosahedron':
			s += 20
	return s
print(mnogogr_cf())


n = int(input())
nums = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
total = 0
while n:
	k = input()
	if k in nums:
		total += nums[k]
	n -= 1
print(total)


n = int(input())
sum = 0
for _ in range(n):
	for poly in input().split():
		if poly == 'Tetrahedron':
			sum += 4
		elif poly == 'Cube':
			sum += 6
		elif poly == 'Octahedron':
			sum += 8
		elif poly == 'Dodecahedron':
			sum += 12
		elif poly == 'Icosahedron':
			sum += 20
print(sum)


n = int(input())
counter = 0
infs = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(n):
	strr = input()
	counter += infs[strr]
print(counter)


def func(n):
	dictionary = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	sum = 0
	for i in range(n):
		k = list(map(str, input().split()))
		sum += dictionary[k[0]]
	print(sum)
n = int(input())
func(n)


def polyhedrons(lst):
	total_edges = 0
	for n in lst:
		if n == 'Tetrahedron':
			total_edges += 4
		elif n == 'Cube':
			total_edges += 6
		elif n == 'Octahedron':
			total_edges += 8
		elif n == 'Dodecahedron':
			total_edges += 12
		elif n == 'Icosahedron':
			total_edges += 20
	return total_edges
n = int(input())
lst = []
for i in range(n):
	lst.append(str(input()))
res = polyhedrons(lst)
print(res)


def main():
	n = int(input())
	d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	add = 0
	for i in range(n):
		string = str(input())
		add += d[string]
	print(add)
main()


n = int(input())
a = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
b = []
sum = 0
for i in range(0, n):
	s = str(input())
	b.append(s)
for i in range(0, n):
	sum += a[b[i]]
print(sum)


nbr = int(input())
Tetrahedron = 4
Cube = 6
Octahedron = 8
Dodecahedron = 12
Icosahedron = 20
face = 0
for i in range(nbr):
	figure = input()
	if figure == 'Tetrahedron':
		face += Tetrahedron
	elif figure == 'Cube':
		face += Cube
	elif figure == 'Octahedron':
		face += Octahedron
	elif figure == 'Dodecahedron':
		face += Dodecahedron
	else:
		face += Icosahedron
print(face)


n = int(input())
m = n
face = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
sum = 0
anton = []
i = 0
while n != 0:
	s = input()
	anton.append(s)
	n -= 1
for j in range(m):
	if anton[j] in face.keys():
		sum += face.get(anton[j])
print(sum)


a = int(input())
objects = []
for i in range(a):
	objects.append(input())
dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
side = 0
for ob in objects:
	side = side + dict[ob]
print(side)


n = int(input())
count = 0
for i in range(n):
	st = str(input())
	if st == 'Tetrahedron':
		count += 4
	elif st == 'Octahedron':
		count += 8
	elif st == 'Dodecahedron':
		count += 12
	elif st == 'Icosahedron':
		count += 20
	else:
		count += 6
print(count)


num = input()
n = int(num)
d = {}
d = {'tetrahedron': 4, 'cube': 6, 'octahedron': 8, 'dodecahedron': 12, 'icosahedron': 20}
sum = 0
for i in range(n):
	s = input().lower()
	for (x, y) in d.items():
		if s in x:
			sum += d[x]
print(sum)


n = int(input())
st = []
while n != 0:
	a = input()
	st.append(a)
	n = n - 1
tetra = st.count('Tetrahedron')
cube = st.count('Cube')
octa = st.count('Octahedron')
dode = st.count('Dodecahedron')
ico = st.count('Icosahedron')
count = tetra * 4 + cube * 6 + octa * 8 + dode * 12 + ico * 20
print(count)


polyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
lst = [polyhedrons[input()] for _ in range(n)]
print(sum(lst))


n = int(input())
s = ''
for i in range(n):
	a = input()
	s = s + a
t = s.count('Tetrahedron') * 4
c = s.count('Cube') * 6
o = s.count('Octahedron') * 8
d = s.count('Dodecahedron') * 12
i = s.count('Icosahedron') * 20
print(t + c + o + d + i)


x = eval(input())
count = 0
for i in range(x):
	string = input()
	if string == 'Tetrahedron':
		count += 4
	elif string == 'Cube':
		count += 6
	elif string == 'Octahedron':
		count += 8
	elif string == 'Dodecahedron':
		count += 12
	else:
		count += 20
print(count)


Polyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
polyhedrons = []
while n:
	polyhedrons.append(input())
	n -= 1
faces = 0
for polyhedron in polyhedrons:
	for key in Polyhedrons:
		if key == polyhedron:
			faces += Polyhedrons[key]
print(faces)


dic = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
tot = 0
for _ in range(int(input())):
	tot += dic[input()]
print(tot)


number_polyhedrons = int(input())
nb_faces = 0
for n in range(number_polyhedrons):
	polyhedron = input()
	if polyhedron == 'Tetrahedron':
		nb_faces += 4
	elif polyhedron == 'Cube':
		nb_faces += 6
	elif polyhedron == 'Octahedron':
		nb_faces += 8
	elif polyhedron == 'Dodecahedron':
		nb_faces += 12
	elif polyhedron == 'Icosahedron':
		nb_faces += 20
print(nb_faces)


x = int(input())
list1 = []
for i in range(x):
	list1.append(str(input()))
y = list1.count('Tetrahedron')
z = list1.count('Cube')
c = list1.count('Octahedron')
v = list1.count('Dodecahedron')
b = list1.count('Icosahedron')
n = y * 4 + z * 6 + c * 8 + v * 12 + b * 20
print(n)


n = int(input())
t = 0
c = 0
o = 0
d = 0
ico = 0
for i in range(n):
	i = input()
	if i == 'Tetrahedron':
		t += 1
	elif i == 'Cube':
		c += 1
	elif i == 'Octahedron':
		o += 1
	elif i == 'Dodecahedron':
		d += 1
	elif i == 'Icosahedron':
		ico += 1
print(t * 4 + c * 6 + o * 8 + d * 12 + ico * 20)


from sys import stdin, stdout
n = int(stdin.readline())
shapes = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
res = 0
for i in range(n):
	res += shapes[stdin.readline().replace('\n', '')]
stdout.write(str(res) + '\n')


n = int(input())
figs = {'T': 0, 'C': 0, 'O': 0, 'D': 0, 'I': 0}
for i in range(0, n):
	data = input()
	figs[data[0]] += 1
res = figs['T'] * 4 + figs['C'] * 6 + figs['O'] * 8 + figs['D'] * 12 + figs['I'] * 20
print(res)


import re
count = 0
a = int(input())
for num in range(a):
	shape = input()
	if re.findall('ahedron', shape):
		if re.findall('Tetr', shape):
			count += 4
		elif re.findall('Icos', shape):
			count += 20
		elif re.findall('Dodec', shape):
			count += 12
		elif re.findall('Oct', shape):
			count += 8
	elif shape == 'Cube':
		count += 6
	else:
		raise TypeError()
print(count)


n = int(input())
s = []
for i in range(n):
	a = input()
	s.append(a)
s1 = 'Tetrahedron'
s2 = 'Cube'
s3 = 'Octahedron'
s4 = 'Dodecahedron'
s5 = 'Icosahedron'
c = 0
for i in s:
	if i == s1:
		c += 4
	elif i == s2:
		c += 6
	elif i == s3:
		c += 8
	elif i == s4:
		c += 12
	elif i == s5:
		c += 20
	else:
		c += 0
print(c)


n = int(input())
r2 = 0
polyhedrons = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
hashmap = [4, 6, 8, 12, 20]
for k in range(0, n):
	m = input()
	r2 += hashmap[polyhedrons.index(m)]
print(r2)


array = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
faces = [4, 6, 8, 12, 20]
n = int(input())
array2 = list()
c = 0
for i in range(n):
	array2.append(input())
	c = c + faces[array.index(array2[i])]
print(c)


n = int(input())
s = 0
Dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for _ in range(n):
	x = input()
	s += Dict[x]
print(s)


import math
import itertools
gh = lambda : map(int, input().split())

def main():
	n = int(input())
	d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	cnt = 0
	while n:
		n -= 1
		x = input()
		cnt += d[x]
	print(cnt)
main()


i_t = int(input(''))
l = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
tot = 0
for _ in range(0, i_t):
	inp = input('')
	tot = tot + l[inp]
print(tot)


n = int(input())
face = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
sum = 0
while n != 0:
	s = input()
	if s in face.keys():
		sum += face.get(s)
	n -= 1
print(sum)


polys = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
t = int(input())
maxSides = 0
for i in range(t):
	maxSides += polys[input()]
print(maxSides)


N = int(input())
d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
ans = 0
for i in range(N):
	ans += d[input()]
print(ans)


count = 0
d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for __ in range(int(input())):
	count += d[input()]
print(count)


number = int(input())
lst = []
for i in range(number):
	polyhedrons = str(input())
	lst.append(polyhedrons)
sumarize = 0
for i in lst:
	if i == 'Tetrahedron':
		sumarize += 4
	if i == 'Cube':
		sumarize += 6
	if i == 'Octahedron':
		sumarize += 8
	if i == 'Dodecahedron':
		sumarize += 12
	if i == 'Icosahedron':
		sumarize += 20
print(sumarize)


num = int(input())
hedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
nh = 0
for i in range(num):
	s = input()
	nh += hedrons[s]
print(nh)


n = int(input())
arr = [input() for i in range(n)]
sides = 0
for i in arr:
	if i == 'Tetrahedron':
		sides += 4
	if i == 'Cube':
		sides += 6
	if i == 'Octahedron':
		sides += 8
	if i == 'Dodecahedron':
		sides += 12
	if i == 'Icosahedron':
		sides += 20
print(sides)


s = input()
sum = 0
for i in range(int(s)):
	line = input()
	if line == 'Tetrahedron':
		sum += 4
	elif line == 'Cube':
		sum += 6
	elif line == 'Octahedron':
		sum += 8
	elif line == 'Dodecahedron':
		sum += 12
	else:
		sum += 20
print(sum)


x = int(input())
t = 0
for i in range(x):
	name = input()
	if name == 'Tetrahedron':
		infa = 4
	elif name == 'Cube':
		infa = 6
	elif name == 'Octahedron':
		infa = 8
	elif name == 'Dodecahedron':
		infa = 12
	elif name == 'Icosahedron':
		infa = 20
	t += infa
print(t)


num = int(input())
count = 0
while num > 0:
	str = input()
	if 'Tetrahedron' in str:
		count += 4
	elif 'Cube' in str:
		count += 6
	elif 'Octahedron' in str:
		count += 8
	elif 'Dodecahedron' in str:
		count += 12
	elif 'Icosahedron' in str:
		count += 20
	num = num - 1
print(count)


a = int(input())
b = 0
for x in range(a):
	c = input()
	if c == 'Tetrahedron':
		b += 4
	elif c == 'Cube':
		b += 6
	elif c == 'Octahedron':
		b += 8
	elif c == 'Dodecahedron':
		b += 12
	else:
		b += 20
print(b)


polyhedron_face_data = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}

def main():
	sum_of_faces = 0
	for _ in range(int(input().strip())):
		polyhedron_name = input().strip()
		sum_of_faces += polyhedron_face_data[polyhedron_name]
	print(sum_of_faces)
main()


polyhedron_guide = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
total_faces = 0
for i in range(0, int(input())):
	total_faces += polyhedron_guide[input()]
print(total_faces)


def main(word):
	score = 0
	for y in word:
		if y == 'T':
			score += 4
		elif y == 'C':
			score += 6
		elif y == 'O':
			score += 8
		elif y == 'D':
			score += 12
		elif y == 'I':
			score += 20
	return score
x = int(input(''))
s = ''
for i in range(0, x):
	s += input('')[0]
print(main(s))


def solve(n, s):
	faces = 0
	for p in s:
		faces += parse(p)
	return faces

def parse(p):
	return {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}.get(p)
n = int(input())
s = []
for i in range(n):
	s.append(input())
print(solve(n, s))


number = int(input())
types_of_polh = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
Dict = {0: 4, 1: 6, 2: 8, 3: 12, 4: 20}
total_sides = 0
for i in range(number):
	a = input()
	for i in types_of_polh:
		if a == i:
			place = types_of_polh.index(i)
			total_sides = total_sides + Dict.get(place)
print(total_sides)


import sys
from enum import Enum
n = int(input())
total = 0
for _ in range(n):
	shape = input().strip()
	if shape == 'Tetrahedron':
		total += 4
	if shape == 'Cube':
		total += 6
	if shape == 'Octahedron':
		total += 8
	if shape == 'Dodecahedron':
		total += 12
	if shape == 'Icosahedron':
		total += 20
print(total)


dizio = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
lista = []
a = input()
a = int(a)
for x in range(a):
	b = input()
	lista.append(b)
cont = 0
for x in lista:
	cont = cont + dizio[x]
print(cont)


T = int(input())
L = []
for i in range(T):
	L.append(input())
c = 0
for l in L:
	if l == 'Tetrahedron':
		c += 4
	elif l == 'Cube':
		c += 6
	elif l == 'Octahedron':
		c += 8
	elif l == 'Dodecahedron':
		c += 12
	elif l == 'Icosahedron':
		c += 20
print(c)


lis = []
second_lis = []
n = int(input())
for i in range(n):
	poly = input()
	lis.append(poly)
for num in lis:
	if num == 'Tetrahedron':
		second_lis.append(4)
	elif num == 'Cube':
		second_lis.append(6)
	elif num == 'Octahedron':
		second_lis.append(8)
	elif num == 'Dodecahedron':
		second_lis.append(12)
	else:
		second_lis.append(20)
print(sum(second_lis))


n = int(input())
dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
sum = 0
a = []
for i in range(n):
	a.append(input())
for i in a:
	if i in dict:
		sum += dict.get(i)
print(sum)


n = int(input())
totfig = list()
totface = 0
for i in range(n):
	fig = input()
	totfig.append(fig)
for i in totfig:
	if i == 'Tetrahedron':
		totface += 4
	elif i == 'Cube':
		totface += 6
	elif i == 'Octahedron':
		totface += 8
	elif i == 'Dodecahedron':
		totface += 12
	elif i == 'Icosahedron':
		totface += 20
print(totface)


n = int(input())
l = []
while n != 0:
	n -= 1
	l.append(input())
count = 0
for x in l:
	if x == 'Tetrahedron':
		count += 4
	elif x == 'Cube':
		count += 6
	elif x == 'Octahedron':
		count += 8
	elif x == 'Dodecahedron':
		count += 12
	else:
		count += 20
print(count)


user = int(input())
total_figure_name = ['tetrahedron', 'cube', 'octahedron', 'dodecahedron', 'icosahedron']
total_figure_no = [4, 6, 8, 12, 20]
sum = 0
for i in range(user):
	user2 = input()
	user2 = user2.lower()
	for j in range(len(total_figure_name)):
		if user2 == total_figure_name[j]:
			sum = sum + total_figure_no[j]
print(sum)


n_polyhedrons = int(input())
total = 0
for i in range(n_polyhedrons):
	polyhedron = input()
	if polyhedron == 'Tetrahedron':
		total += 4
	elif polyhedron == 'Cube':
		total += 6
	elif polyhedron == 'Octahedron':
		total += 8
	elif polyhedron == 'Dodecahedron':
		total += 12
	elif polyhedron == 'Icosahedron':
		total += 20
print(total)


cases = int(input())
dic = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
total = 0
for case in range(cases):
	total += dic[input()]
print(total)


n = int(input())
answer = 0
name = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
m = [4, 6, 8, 12, 20]
for i in range(n):
	s = str(input())
	answer += m[name.index(s)]
print(answer)


n = int(input())
polyhedrons = []
for i in range(n):
	polyhedrons.append(input())
tetrahedrons = polyhedrons.count('Tetrahedron')
cubes = polyhedrons.count('Cube')
octahedrons = polyhedrons.count('Octahedron')
dodecahedrons = polyhedrons.count('Dodecahedron')
icosahedrons = polyhedrons.count('Icosahedron')
faces = 4 * tetrahedrons + 6 * cubes + 8 * octahedrons + 12 * dodecahedrons + 20 * icosahedrons
print(faces)


n = int(input())
shapes = []
count = 0
for _ in range(n):
	shapes.append(input())
for item in shapes:
	if item[0] == 'T':
		count += 4
	elif item[0] == 'C':
		count += 6
	elif item[0] == 'O':
		count += 8
	elif item[0] == 'D':
		count += 12
	else:
		count += 20
print(count)


number = int(input())
total = 0
for x in range(number):
	shape = input()
	if shape == 'Icosahedron':
		total += 20
	elif shape == 'Dodecahedron':
		total += 12
	elif shape == 'Octahedron':
		total += 8
	elif shape == 'Cube':
		total += 6
	elif shape == 'Tetrahedron':
		total += 4
print(total)


def totalNumOfFaces(polyhedronList):
	pdict = {}
	pdict.setdefault('Tetrahedron', 4)
	pdict.setdefault('Cube', 6)
	pdict.setdefault('Octahedron', 8)
	pdict.setdefault('Dodecahedron', 12)
	pdict.setdefault('Icosahedron', 20)
	sideCount = 0
	for i in range(0, len(polyhedronList)):
		sideCount += pdict.get(polyhedronList[i])
	return sideCount

def main():
	n = int(input())
	polyhedronList = []
	for i in range(0, n):
		polyhedronList.append(input())
	print(totalNumOfFaces(polyhedronList))
main()


n = int(input())
inp = [''] * n
for i in range(n):
	inp[i] = input()
cT = inp.count('Tetrahedron')
cC = inp.count('Cube')
cO = inp.count('Octahedron')
cD = inp.count('Dodecahedron')
cI = inp.count('Icosahedron')
count = 4 * cT + 6 * cC + 8 * cO + 12 * cD + 20 * cI
print(count)


n = int(input())
polyhedrons = []
sum = 0
translate = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for _ in range(n):
	polyhedrons.append(input())
for poly in polyhedrons:
	sum += translate[poly]
print(sum)


tet = str('Tetrahedron')
cube = str('Cube')
oct = str('Octahedron')
dod = str('Dodecahedron')
ico = str('Icosahedron')
faces = 0
n = int(input())
while n != 0:
	s = str(input())
	if s == tet:
		faces = faces + 4
	elif s == cube:
		faces = faces + 6
	elif s == oct:
		faces = faces + 8
	elif s == dod:
		faces = faces + 12
	elif s == ico:
		faces = faces + 20
	n = n - 1
print(faces)


many = 0
for i in range(int(input())):
	y = input()
	if y == 'Tetrahedron':
		many += 4
	elif y == 'Cube':
		many += 6
	elif y == 'Octahedron':
		many += 8
	elif y == 'Dodecahedron':
		many += 12
	elif y == 'Icosahedron':
		many += 20
print(many)


sides = 0
for i in range(int(input())):
	size = input()
	if size == 'Tetrahedron':
		sides += 4
	elif size == 'Cube':
		sides += 6
	elif size == 'Octahedron':
		sides += 8
	elif size == 'Dodecahedron':
		sides += 12
	elif size == 'Icosahedron':
		sides += 20
print(str(sides))


n = int(input())
kol = 0
for i in range(n):
	gran = input()
	if gran == 'Tetrahedron':
		kol += 4
	if gran == 'Cube':
		kol += 6
	if gran == 'Octahedron':
		kol += 8
	if gran == 'Dodecahedron':
		kol += 12
	if gran == 'Icosahedron':
		kol += 20
print(kol)


a = int(input())
b = [i + i for i in range(0, a)]
counter = 0
fin = 0
while counter < a:
	b[counter] = input()
	if b[counter] == 'Tetrahedron':
		fin += 4
	elif b[counter] == 'Cube':
		fin += 6
	elif b[counter] == 'Octahedron':
		fin += 8
	elif b[counter] == 'Dodecahedron':
		fin += 12
	elif b[counter] == 'Icosahedron':
		fin += 20
	counter += 1
print(fin)


while True:
	n = int(input())
	if 1 <= n <= 200000:
		break
P = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
s = 0
for i in range(n):
	st = input()
	s += P[st]
print(s)


def r(t=int):
	return list(map(t, input().split()))

def ri(t=int):
	return t(input())

def cd(it):
	ret_val = dict()
	for v in it:
		ret_val[v] = ret_val.get(v, 0) + 1
	return ret_val
d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = ri()
ans = 0
for _ in range(n):
	ans += d[input()]
print(ans)


i = 0
num = 0
polyhedrons = int(input())
while i < polyhedrons:
	polyhedron = input()
	if polyhedron == 'Tetrahedron':
		num += 4
	elif polyhedron == 'Cube':
		num += 6
	elif polyhedron == 'Octahedron':
		num += 8
	elif polyhedron == 'Dodecahedron':
		num += 12
	elif polyhedron == 'Icosahedron':
		num += 20
	i += 1
print(num)


dict = {}
dict['Tetrahedron'] = '4'
dict['Cube'] = '6'
dict['Octahedron'] = '8'
dict['Dodecahedron'] = '12'
dict['Icosahedron'] = '20'
l = []
k = 0
x = int(input())
i = 0
while i < x:
	i += 1
	s = input()
	l.append(s)
for i in l:
	k += int(dict[i])
print(k)


T = int(input())
i = 0
sum = 0
while i < T:
	a = input()
	if a[0:4] == 'Icos':
		sum = sum + 20
	elif a[0:4] == 'Dode':
		sum = sum + 12
	elif a[0:4] == 'Octa':
		sum = sum + 8
	elif a[0:4] == 'Cube':
		sum = sum + 6
	elif a[0:4] == 'Tetr':
		sum = sum + 4
	else:
		sum = sum + 0
	i = i + 1
print(sum)


a = int(input())
m = 0
for r in range(0, a):
	b = input()
	if b == 'Tetrahedron':
		m = m + 4
	elif b == 'Cube':
		m = m + 6
	elif b == 'Octahedron':
		m = m + 8
	elif b == 'Dodecahedron':
		m = m + 12
	elif b == 'Icosahedron':
		m = m + 20
print(m)


FACES = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}

def main():
	n = int(input())
	faces = 0
	for i in range(n):
		faces += FACES[input()]
	print(faces)
main()


n = int(input())
sum = 0
for i in range(n):
	a = input()
	b = a.lower()
	if b == 'tetrahedron':
		sum += 4
	elif b == 'cube':
		sum += 6
	elif b == 'octahedron':
		sum += 8
	elif b == 'dodecahedron':
		sum += 12
	elif b == 'icosahedron':
		sum += 20
print(sum)


import sys
num_inputs = int(sys.stdin.readline().strip())
shape_inputs = [shape.strip() for shape in sys.stdin.readlines()]
POLYHEDRONS = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
total_sides = sum([POLYHEDRONS[shape] for shape in shape_inputs])
print(total_sides)


li = ['T', 'C', 'O', 'D', 'I']
li1 = [4, 6, 8, 12, 20]
n = int(input())
s = 0
i = 0
while i < n:
	st = input()
	if st[0] == 'T':
		s += 4
	elif st[0] == 'C':
		s += 6
	elif st[0] == 'O':
		s += 8
	elif st[0] == 'D':
		s += 12
	elif st[0] == 'I':
		s += 20
	i += 1
print(s)


vsota = 0
j = 0
lst = []
n = int(input())
for i in range(0, n):
	ele = input()
	lst.append(ele)
while j < n:
	if lst[j] == 'Tetrahedron':
		vsota += 4
		j += 1
	elif lst[j] == 'Cube':
		vsota += 6
		j += 1
	elif lst[j] == 'Octahedron':
		vsota += 8
		j += 1
	elif lst[j] == 'Dodecahedron':
		vsota += 12
		j += 1
	elif lst[j] == 'Icosahedron':
		vsota += 20
		j += 1
print(vsota)


n = int(input())
lista = []
for i in range(n):
	lista.append(input())
polyhedrons = {'tetrahedron': 4, 'cube': 6, 'octahedron': 8, 'dodecahedron': 12, 'icosahedron': 20}
soma = 0
for i in range(n):
	item = lista[i]
	n = polyhedrons[item.lower()]
	soma = soma + n
print(soma)


n = int(input())
h = k = l = m = p = 0
for i in range(n):
	s = input()
	if s == 'Tetrahedron':
		h += 1
	elif s == 'Cube':
		k += 1
	elif s == 'Octahedron':
		l += 1
	elif s == 'Dodecahedron':
		m += 1
	else:
		p += 1
print(h * 4 + k * 6 + l * 8 + m * 12 + p * 20)


col = 0
num = int(input())
a = ''
for j in range(num):
	a = input()
	if a == 'Tetrahedron':
		col += 4
	if a == 'Cube':
		col += 6
	if a == 'Octahedron':
		col += 8
	if a == 'Dodecahedron':
		col += 12
	if a == 'Icosahedron':
		col += 20
print(col)


num = int(input())
plus = 0
arr = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(num):
	some = input()
	plus += arr[some]
print(plus)


import math
import cmath
import sys
sys.setrecursionlimit(200005)
n = int(input())
t = 0
for i in range(n):
	s = input()
	if s == 'Tetrahedron':
		t += 4
	elif s == 'Cube':
		t += 6
	elif s == 'Octahedron':
		t += 8
	elif s == 'Dodecahedron':
		t += 12
	else:
		t += 20
print(t)


a = {'Octahedron': 8, 'Dodecahedron': 12, 'Tetrahedron': 4, 'Icosahedron': 20, 'Cube': 6}
n = int(input())
res = 0
for i in range(n):
	res += a.get(str(input()))
print(res)


n = int(input())
t = 0
for i in range(n):
	w = list(input())
	if w[0] == 'T':
		t = t + 4
	elif w[0] == 'C':
		t = t + 6
	elif w[0] == 'O':
		t = t + 8
	elif w[0] == 'D':
		t = t + 12
	elif w[0] == 'I':
		t = t + 20
print(t)


(t, c) = (int(input()), 0)
for _ in range(t):
	tmp = input()[0]
	if tmp == 'T':
		c += 4
	elif tmp == 'C':
		c += 6
	elif tmp == 'O':
		c += 8
	elif tmp == 'D':
		c += 12
	else:
		c += 20
print(c)


n = int(input())
polyhed_dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
i = 1
faces = 0
while i <= n:
	type = input()
	faces += polyhed_dict[type]
	i += 1
print(faces)


n = int(input())
if 1 <= n <= 2 * 10 ** 5:
	faces = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	total = 0
	for i in range(n):
		face = input()
		total += faces[face]
	print(total)


from sys import stdin

def main():
	figures = {}
	figures['Tetrahedron'] = 4
	figures['Cube'] = 6
	figures['Octahedron'] = 8
	figures['Dodecahedron'] = 12
	figures['Icosahedron'] = 20
	n = int(stdin.readline())
	ans = 0
	for i in range(n):
		query = stdin.readline().strip()
		if figures.get(query) != None:
			ans += figures[query]
	print(ans)
main()


this = dict(Icosahedron=int(20))
this['Dodecahedron'] = 12
this['Octahedron'] = 8
this['Cube'] = 6
this['Tetrahedron'] = 4
n = int(input())
cnt = 0
for i in range(n):
	s = input()
	cnt += this[s]
print(cnt)


n = int(input())
count = 0
while n > 0:
	n -= 1
	s = input()
	if s == 'Icosahedron':
		count += 20
	elif s == 'Cube':
		count += 6
	elif s == 'Tetrahedron':
		count += 4
	elif s == 'Dodecahedron':
		count += 12
	else:
		count += 8
print(count)


n = input()
polyhedrons = []
faces = 0
for num in range(0, int(n)):
	collection = input()
	polyhedrons.append(collection)
for each_item in polyhedrons:
	if each_item.lower() == 'tetrahedron':
		faces += 4
	elif each_item.lower() == 'cube':
		faces += 6
	elif each_item.lower() == 'octahedron':
		faces += 8
	elif each_item.lower() == 'dodecahedron':
		faces += 12
	elif each_item.lower() == 'icosahedron':
		faces += 20
print(faces)


mapper = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
total_faces = 0
n = int(input())
for _ in range(n):
	poly = str(input())
	total_faces += mapper[poly]
print(total_faces)


def face(values):
	figure = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	total = 0
	for value in values:
		total = total + figure[value]
	return total
n = int(input())
values = []
for i in range(n):
	value = input()
	values.append(value)
print(face(values))


n = int(input())
faces = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
total = 0
for i in range(n):
	s = input()
	total += faces.get(s[0])
print(total)


from collections import Counter
n = int(input())
cnt = Counter([input() for _ in range(n)])
ans = cnt['Tetrahedron'] * 4 + cnt['Cube'] * 6 + cnt['Octahedron'] * 8 + cnt['Dodecahedron'] * 12 + cnt['Icosahedron'] * 20
print(ans)


import sys
face_map = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
ans = 0
for i in range(n):
	s = input()
	ans += face_map[s]
print(ans)


n = int(input())
shapes = []
for _ in range(n):
	shapes.append(input())
shape_faces = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
ans = 0
for shape in shapes:
	ans += shape_faces[shape]
print(ans)


amt = int(input())
amtsur = 0
for i in range(amt):
	xx = input()[0]
	amtsur = amtsur + xx.count('T') * 4 + xx.count('C') * 6 + xx.count('O') * 8 + xx.count('D') * 12 + xx.count('I') * 20
print(amtsur)


def main(sc):
	n = sc.next_int()
	freq = {'Tetrahedron': 0, 'Cube': 0, 'Octahedron': 0, 'Dodecahedron': 0, 'Icosahedron': 0}
	for i in range(n):
		str = sc.next_string()
		freq[str] += 1
	ans = 4 * freq['Tetrahedron'] + 6 * freq['Cube'] + 8 * freq['Octahedron'] + 12 * freq['Dodecahedron'] + 20 * freq['Icosahedron']
	print(ans)

class Scanner:

	def __init__(self):
		self.idx = 0
		self.tokens = []

	def next(self):
		while self.idx == len(self.tokens) or not len(self.tokens[self.idx]):
			if self.idx == len(self.tokens):
				self.idx = 0
				self.tokens = input().split()
			else:
				self.idx += 1
		self.idx += 1
		return self.tokens[self.idx - 1]

	def next_string(self):
		return self.next()

	def next_strings(self, n):
		return [self.next_string() for i in range(0, n)]

	def next_int(self):
		return int(self.next())

	def next_ints(self, n):
		return [self.next_int() for i in range(0, n)]
scanner = Scanner()
main(scanner)


polygon = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
collect = []
face = 0
for i in range(n):
	pol = input()
	collect.append(pol)
for j in collect:
	face += polygon[j]
print(face)


n = int(input())
l = []
ls = []
for i in range(n):
	l.append(input())
for i in range(n):
	if l[i][0] == 'T':
		ls.append(4)
	if l[i][0] == 'C':
		ls.append(6)
	if l[i][0] == 'O':
		ls.append(8)
	if l[i][0] == 'D':
		ls.append(12)
	if l[i][0] == 'I':
		ls.append(20)
print(sum(ls))


n = int(input())
a = []
s = 0
for i in range(n):
	a.append(input())
for elem in a:
	if elem[0] == 'T':
		s += 4
	elif elem[0] == 'C':
		s += 6
	elif elem[0] == 'O':
		s += 8
	elif elem[0] == 'D':
		s += 12
	else:
		s += 20
print(s)


c = 0
for i in [0] * int(input()):
	a = input()
	if a[0] == 'I':
		c += 20
	elif a[0] == 'D':
		c += 12
	elif a[0] == 'O':
		c += 8
	elif a[0] == 'C':
		c += 6
	else:
		c += 4
print(c)


No = int(input())
NameList = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
FaceList = [4, 6, 8, 12, 20]
res = 0
for i in range(No):
	Inp = input()
	Index = NameList.index(Inp)
	res = res + FaceList[Index]
print(res)


mas = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
m = [4, 6, 8, 12, 20]
ans = 0
n = int(input())
for i in range(n):
	a = mas.index(str(input()))
	ans += m[a]
print(ans)


polyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
size_tot = int(input())
faces_tot = 0
for i in range(0, size_tot):
	polyhedron = input()
	faces_tot += polyhedrons[polyhedron]
print(faces_tot)


n = int(input())
sum = 0
polyhedrons = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
numFaces = [4, 6, 8, 12, 20]
a = []
for i in range(n):
	a.append(input())
for i in range(len(polyhedrons)):
	sum = sum + a.count(polyhedrons[i]) * numFaces[i]
print(sum)


t = int(input())
p = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
f = [4, 6, 8, 12, 20]
dic = {p[i]: f[i] for i in range(5)}
total = 0
for z in range(t):
	x = input()
	total += dic[x]
print(total)


integ = int(input())
shapes = {'Tetrahedron': 4, 'Dodecahedron': 12, 'Icosahedron': 20, 'Cube': 6, 'Octahedron': 8}
ctr = 0
for i in range(0, integ):
	shape = input()
	ctr += shapes.get(shape)
print(ctr)


import sys
n = int(sys.stdin.readline())
faces = 0
for i in range(n):
	input = sys.stdin.readline().strip()
	if input == 'Tetrahedron':
		faces += 4
	if input == 'Cube':
		faces += 6
	if input == 'Octahedron':
		faces += 8
	if input == 'Dodecahedron':
		faces += 12
	if input == 'Icosahedron':
		faces += 20
print(faces)


sum1 = 0
for i in range(int(input())):
	temp = input()
	if temp == 'Icosahedron':
		sum1 += 20
	elif temp == 'Dodecahedron':
		sum1 += 12
	elif temp == 'Octahedron':
		sum1 += 8
	elif temp == 'Cube':
		sum1 += 6
	elif temp == 'Tetrahedron':
		sum1 += 4
	else:
		continue
print(sum1)


n = input()
a = input()
lis = [a]
for i in range(1, int(n)):
	b = input()
	lis.append(b)
c = {}
for item in lis:
	c[item] = c.get(item, 0) + 1
val1 = 0
val2 = 0
val3 = 0
val4 = 0
val5 = 0
if 'Tetrahedron' in c:
	val1 = c['Tetrahedron'] * 4
if 'Cube' in c:
	val2 = c['Cube'] * 6
if 'Octahedron' in c:
	val3 = c['Octahedron'] * 8
if 'Dodecahedron' in c:
	val4 = c['Dodecahedron'] * 12
if 'Icosahedron' in c:
	val5 = c['Icosahedron'] * 20
print(val1 + val2 + val3 + val4 + val5)


t = int(input())
sum1 = 0
while t != 0:
	t -= 1
	a = str(input())
	i = 0
	if a == 'Icosahedron':
		sum1 += 20
	elif a == 'Dodecahedron':
		sum1 += 12
	elif a == 'Tetrahedron':
		sum1 += 4
	elif a == 'Cube':
		sum1 += 6
	elif a == 'Octahedron':
		sum1 += 8
print(sum1)


faces = 0
collection = []
n = int(input())
for x in range(n):
	collection.append(str(input()))
for x in collection:
	if x == 'Tetrahedron':
		faces += 4
	elif x == 'Cube':
		faces += 6
	elif x == 'Octahedron':
		faces += 8
	elif x == 'Dodecahedron':
		faces += 12
	elif x == 'Icosahedron':
		faces += 20
print(faces)


from sys import stdin, stdout
faces = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(stdin.readline())
total = 0
for i in range(n):
	total += faces[stdin.readline().rstrip()]
stdout.write(str(total))


n = int(input())
a = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
b = []
for x in range(n):
	i = input()
	for y in a:
		if y == i:
			b.append(a[y])
print(sum(b))


n = int(input())
z = 0
for x in range(n):
	faces = input()
	if faces == 'Tetrahedron':
		z += 4
	if faces == 'Cube':
		z += 6
	if faces == 'Octahedron':
		z += 8
	if faces == 'Dodecahedron':
		z += 12
	if faces == 'Icosahedron':
		z += 20
print(z)


n = int(input())
summation = 0
shape_dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(n):
	shape = input()
	summation += shape_dict[shape]
print(summation)


import sys
data = sys.stdin.readlines()
n = int(data[0].split()[0])
dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
regulars = [x.split()[0] for x in data[1:]]
sys.stdout.write(str(sum([dict.get(x) for x in regulars])))


n = int(input())
i = int(0)
x = int(0)
total = int(0)
collection = []
while i < n:
	collection.append(input())
	i += 1
while x < len(collection):
	if collection[x] == 'Tetrahedron':
		total += 4
	elif collection[x] == 'Cube':
		total += 6
	elif collection[x] == 'Octahedron':
		total += 8
	elif collection[x] == 'Dodecahedron':
		total += 12
	elif collection[x] == 'Icosahedron':
		total += 20
	x += 1
print(total)


n = int(input())
t = 'Tetrahedron'
c = 'Cube'
o = 'Octahedron'
d = 'Dodecahedron'
i = 'Icosahedron'
at = 0
ac = 0
ao = 0
ad = 0
ai = 0
asum = 0
for _ in range(n):
	b = input()
	if t == b and at == 0:
		asum += 4
	elif c == b and ac == 0:
		asum += 6
	elif o == b and ao == 0:
		asum += 8
	elif d == b and ad == 0:
		asum += 12
	elif i == b and ai == 0:
		asum += 20
print(asum)


def poly_func(polyhedrons):
	dict_polyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	suma = 0
	for value in polyhedrons:
		suma += dict_polyhedrons[value]
	return suma
polyhedrons = []
n = int(input())
for i in range(0, n):
	polyhedrons.append(input())
print(poly_func(polyhedrons))


n = int(input())
cnt = 0
arr = [4, 6, 8, 12, 20]
arr2 = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
for i in range(n):
	a = input()
	cnt += arr[arr2.index(a)]
print(cnt)


def main():
	n = int(input())
	num_faces = 0
	for i in range(n):
		face = input()
		if face == 'Tetrahedron':
			num_faces += 4
		elif face == 'Cube':
			num_faces += 6
		elif face == 'Octahedron':
			num_faces += 8
		elif face == 'Dodecahedron':
			num_faces += 12
		elif face == 'Icosahedron':
			num_faces += 20
	print(num_faces)
main()


from sys import stdin, stdout
anzahl = int(stdin.readline().rstrip())
n = []
for x in range(0, anzahl):
	n.append(stdin.readline().rstrip())
number = 0
for x in n:
	if x == 'Icosahedron':
		number += 20
	elif x == 'Cube':
		number += 6
	elif x == 'Tetrahedron':
		number += 4
	elif x == 'Dodecahedron':
		number += 12
	elif x == 'Octahedron':
		number += 8
stdout.write(str(number))


def main(lis):
	count = 0
	for word in lis:
		if word == 'Tetrahedron':
			count = count + 4
		if word == 'Cube':
			count = count + 6
		if word == 'Octahedron':
			count = count + 8
		if word == 'Dodecahedron':
			count = count + 12
		if word == 'Icosahedron':
			count = count + 20
	return count
col = int(input())
lis = []
for i in range(col):
	string = input()
	lis.append(string)
print(main(lis))


Tetra = 4
Cub = 6
Octa = 8
Dodeca = 12
Icosa = 20
lst = list()
n = int(input())
i = 0
while i < n:
	lst.append(input())
	i = i + 1
sum = 0
j = 0
while j < len(lst):
	if lst[j] == 'Tetrahedron':
		sum = sum + Tetra
	elif lst[j] == 'Cube':
		sum = sum + Cub
	elif lst[j] == 'Octahedron':
		sum = sum + Octa
	elif lst[j] == 'Dodecahedron':
		sum = sum + Dodeca
	elif lst[j] == 'Icosahedron':
		sum = sum + Icosa
	j = j + 1
print(sum)


d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
k = 0
for i in range(n):
	x = input()
	t = d[x]
	k = k + t
print(k)


n = int(input())
dice = [None] * n
for i in range(n):
	dice[i] = input()
res = 0
for d in dice:
	if d == 'Tetrahedron':
		res += 4
	elif d == 'Cube':
		res += 6
	elif d == 'Octahedron':
		res += 8
	elif d == 'Dodecahedron':
		res += 12
	else:
		res += 20
print(res)


weights = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
total = 0
for i in range(n):
	shape = input()
	total += weights[shape]
print(total)


poly = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
sum = 0
i = 0
items = input()
for i in range(1, int(items) + 1):
	inputs = input()
	if inputs.capitalize() in poly.keys():
		sum += poly[inputs.capitalize()]
print(sum)


num = int(input())
test = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
c = 0
for _ in range(num):
	c += test[input()]
print(c)


n = int(input())
words = []
sum = int('0')
side_counts = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(n):
	words.append(input())
for word in words:
	sum += side_counts[word]
print(sum)


n = int(input())
s = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
f = [4, 6, 8, 12, 20]
tot = 0
z = [0] * 5
for _ in range(n):
	a = input()
	j = s.index(a)
	z[j] += 1
for i in range(5):
	tot += z[i] * f[i]
print(tot)


n = int(input())
if n < 1 or n > 200000:
	exit(0)
else:
	total = 0
	for x in range(n):
		poly = str(input())
		if poly == 'Tetrahedron':
			total = total + 4
		if poly == 'Cube':
			total = total + 6
		if poly == 'Octahedron':
			total = total + 8
		if poly == 'Dodecahedron':
			total = total + 12
		if poly == 'Icosahedron':
			total = total + 20
	print(total)


n = int(input())
answer = 0
for i in range(n):
	kind = input()
	first = kind[0]
	if first == 'T':
		answer += 4
	elif first == 'C':
		answer += 6
	elif first == 'O':
		answer += 8
	elif first == 'D':
		answer += 12
	else:
		answer += 20
print(answer)


import sys
n = int(sys.stdin.readline())
lst = []
for i in range(n):
	lst.append(str(sys.stdin.readline()))
Dict = {'Tetrahedron\n': 4, 'Cube\n': 6, 'Octahedron\n': 8, 'Dodecahedron\n': 12, 'Icosahedron\n': 20}
sum = 0
for i in range(n):
	sum += Dict[lst[i]]
print(sum)


def solve():
	n = int(input())
	c = 0
	d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	for _ in range(n):
		s = input()
		c += d[s]
	print(c)
solve()


i = int(input())
j = 0
faces = 0
while j < i:
	k = str(input())
	if k == 'Tetrahedron':
		faces = faces + 4
		j += 1
	elif k == 'Cube':
		faces = faces + 6
		j += 1
	elif k == 'Octahedron':
		faces = faces + 8
		j += 1
	elif k == 'Dodecahedron':
		faces = faces + 12
		j += 1
	elif k == 'Icosahedron':
		faces = faces + 20
		j += 1
print(faces)


d = dict()
d['Icosahedron'] = 20
d['Cube'] = 6
d['Tetrahedron'] = 4
d['Dodecahedron'] = 12
d['Octahedron'] = 8
count = int(input())
sum_ = 0
for _ in range(count):
	sum_ += d[input()]
print(sum_)


n = int(input())
d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
l = []
for i in range(n):
	l.append(input())
total = 0
for i in l:
	total += d[i]
print(total)


tlist = []
n = int(input())
for i in range(0, n):
	ele = input()
	tlist.append(ele)
tdict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
t = 0
for x in tlist:
	t = int(tdict[x]) + t
print(t)


nb = 0
for i in range(int(input())):
	ch = input()
	if ch == 'Tetrahedron':
		nb += 4
	elif ch == 'Cube':
		nb += 6
	elif ch == 'Octahedron':
		nb += 8
	elif ch == 'Dodecahedron':
		nb += 12
	elif ch == 'Icosahedron':
		nb += 20
print(nb)


n = int(input())
s = 0

def face(a):
	if a == 'Tetrahedron':
		return 4
	if a == 'Cube':
		return 6
	if a == 'Octahedron':
		return 8
	if a == 'Dodecahedron':
		return 12
	if a == 'Icosahedron':
		return 20
for i in range(n):
	x = input()
	s = s + face(x)
print(s)


s = 0
n = int(input())
l = []
dic = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(n):
	l.append(input())
for i in set(l):
	m = dic.get(i) * l.count(i)
	s += m
print(s)


t = int(input())
sides = 0
for i in range(t):
	s = input()
	if s[0] == 'T':
		sides += 4
	elif s[0] == 'C':
		sides += 6
	elif s[0] == 'O':
		sides += 8
	elif s[0] == 'D':
		sides += 12
	else:
		sides += 20
print(sides)


b = input()
b = int(b)
edge = 0
for i in range(b):
	s = input()
	if s == 'Tetrahedron':
		edge += 4
	elif s == 'Cube':
		edge += 6
	elif s == 'Octahedron':
		edge += 8
	elif s == 'Dodecahedron':
		edge += 12
	elif s == 'Icosahedron':
		edge += 20
print(int(edge))


n = int(input())
polyhedrons_list = []
sample_polyhedrons = {'tetrahedron': 4, 'cube': 6, 'octahedron': 8, 'dodecahedron': 12, 'icosahedron': 20}
for i in range(n):
	polyhedron = input()
	if polyhedron:
		polyhedrons_list.append(polyhedron.lower())
total = 0
for polyhedron in polyhedrons_list:
	if polyhedron in sample_polyhedrons.keys():
		total = total + sample_polyhedrons[polyhedron]
print(total)


polyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
ph = []
for j in range(n):
	ph.append(input())
sumofph = 0
for i in range(len(ph)):
	sumofph = sumofph + polyhedrons.get(ph[i])
print(sumofph)


from sys import stdin, stdout
faces = 0
poly = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(stdin.readline())
for i in range(n):
	col = input()
	faces += poly.get(col)
print(faces)


n = int(input())
t = 0
c = 0
u = 0
o = 0
d = 0
for i in range(n):
	b = input()
	a = list(b)
	if a[0] == 'T':
		t = t + 1
	elif a[0] == 'C':
		c = c + 1
	elif a[0] == 'O':
		o = o + 1
	elif a[0] == 'D':
		d = d + 1
	elif a[0] == 'I':
		u = u + 1
print(4 * t + 6 * c + 8 * o + 12 * d + 20 * u)


k = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
print(sum((k.get(input()[:1]) for case in range(int(input())))))


n = int(input())
i = 0
a = []
output = 0
while i < n:
	a.append(input())
	i += 1
for ngone in a:
	if ngone == 'Tetrahedron':
		output += 4
	elif ngone == 'Cube':
		output += 6
	elif ngone == 'Octahedron':
		output += 8
	elif ngone == 'Dodecahedron':
		output += 12
	elif ngone == 'Icosahedron':
		output += 20
print(output)


n = int(input())
l = []
for i in range(n):
	s = input()
	l.append(s)
f = 0
d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
j = list(d.keys())
for i in l:
	if i in j:
		f = f + d[i]
print(f)


import sys
new = ''
total = 0
n = int(input())
for x in range(0, n):
	new = input()
	if new == 'Tetrahedron':
		total += 4
	elif new == 'Cube':
		total += 6
	elif new == 'Octahedron':
		total += 8
	elif new == 'Dodecahedron':
		total += 12
	else:
		total += 20
print(total)


n = int(input())
figure = dict({'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20})
ans = 0
for i in range(n):
	ans += figure.get(input())
print(ans)


t = int(input())
cn = 0
for i in range(t):
	s = input()
	if s[:4] == 'Tetr':
		cn = cn + 4
	elif s[:4] == 'Cube':
		cn = cn + 6
	elif s[:4] == 'Octa':
		cn = cn + 8
	elif s[:4] == 'Dode':
		cn = cn + 12
	elif s[:4] == 'Icos':
		cn = cn + 20
print(cn)


st = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
nu = [4, 6, 8, 12, 20]
n = int(input())
result = 0
for i in range(n):
	stt = input()
	result = result + nu[st.index(stt)]
print(result)


import sys
numCases = int(input())
output = 0
while numCases > 0:
	numCases -= 1
	poly = input()
	if poly[0] == 'T':
		output = output + 4
	elif poly[0] == 'C':
		output = output + 6
	elif poly[0] == 'O':
		output = output + 8
	elif poly[0] == 'D':
		output = output + 12
	elif poly[0] == 'I':
		output = output + 20
print(output)


n = int(input())
tetra = 0
octa = 0
cube = 0
dode = 0
iso = 0
for i in range(n):
	t = input()
	if t == 'Tetrahedron':
		tetra += 1
	elif t == 'Octahedron':
		octa += 1
	elif t == 'Cube':
		cube += 1
	elif t == 'Dodecahedron':
		dode += 1
	elif t == 'Icosahedron':
		iso += 1
print(tetra * 4 + cube * 6 + octa * 8 + dode * 12 + iso * 20)


def faces(poly):
	_dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	total = 0
	poly = int(poly)
	while poly > 0:
		x = input()
		total += _dict[x]
		poly -= 1
	return total
_poly = input()
print(faces(_poly))


s = int(input())
te = 0
cu = 0
oc = 0
do = 0
ic = 0
for i in range(s):
	d = input()
	if d == 'Tetrahedron':
		te += 1
	elif d == 'Cube':
		cu += 1
	elif d == 'Octahedron':
		oc += 1
	elif d == 'Dodecahedron':
		do += 1
	else:
		ic += 1
print(te * 4 + cu * 6 + oc * 8 + do * 12 + ic * 20)


n = int(input())
ans = 0
for i in range(n):
	x = input()
	if x == 'Icosahedron':
		ans += 20
	elif x == 'Dodecahedron':
		ans += 12
	elif x == 'Octahedron':
		ans += 8
	elif x == 'Cube':
		ans += 6
	else:
		ans += 4
print(ans)


n = int(input())
a = [0] * 21
a[4] = 'T'
a[6] = 'C'
a[8] = 'O'
a[12] = 'D'
a[20] = 'I'
l = 0
for i in range(n):
	s = input()
	l += a.index(s[0])
print(l)


n = int(input())
L = []
for i in range(n):
	L.append(str(input()))
faces = 0
for element in L:
	if element == 'Icosahedron':
		faces += 20
	elif element == 'Dodecahedron':
		faces += 12
	elif element == 'Octahedron':
		faces += 8
	elif element == 'Cube':
		faces += 6
	elif element == 'Tetrahedron':
		faces += 4
print(faces)


n = int(input())
l = []
ans = 0
for j in range(0, n):
	x = input()
	l.append(x)
for k in range(0, n):
	if l[k] == 'Tetrahedron':
		ans = ans + 4
	elif l[k] == 'Cube':
		ans = ans + 6
	elif l[k] == 'Octahedron':
		ans = ans + 8
	elif l[k] == 'Dodecahedron':
		ans = ans + 12
	else:
		ans = ans + 20
print(ans)


n = input()
a = int()
for i in range(int(n)):
	sheet = input()
	if sheet == 'Tetrahedron':
		a = a + 4
	elif sheet == 'Cube':
		a = a + 6
	elif sheet == 'Octahedron':
		a = a + 8
	elif sheet == 'Dodecahedron':
		a = a + 12
	elif sheet == 'Icosahedron':
		a = a + 20
print(a)


import sys
import math as mt
t = 1
for ___ in range(t):
	n = int(input())
	d = {}
	d['Tetrahedron'] = 4
	d['Cube'] = 6
	d['Octahedron'] = 8
	d['Dodecahedron'] = 12
	d['Icosahedron'] = 20
	suma = 0
	for ____ in range(n):
		s = input()
		suma += d[s]
	print(suma)


n = int(input(''))
polyhedrons = []
i = 0
faces = 0
while i < n:
	fig = input('')
	fig.capitalize()
	polyhedrons.append(fig)
	if polyhedrons[i] == 'Tetrahedron':
		faces += 4
	elif polyhedrons[i] == 'Cube':
		faces += 6
	elif polyhedrons[i] == 'Octahedron':
		faces += 8
	elif polyhedrons[i] == 'Dodecahedron':
		faces += 12
	elif polyhedrons[i] == 'Icosahedron':
		faces += 20
	i += 1
print(faces)


n = int(input())
faces = 0
while n:
	name = input()
	if name == 'Icosahedron':
		faces += 20
	elif name == 'Tetrahedron':
		faces += 4
	elif name == 'Dodecahedron':
		faces += 12
	elif name == 'Cube':
		faces += 6
	else:
		faces += 8
	n -= 1
print(faces)


n = int(input())
s = []
for i in range(n):
	s.append(input())
count = 0
for w in s:
	if w[0] == 'T':
		count += 4
	elif w[0] == 'C':
		count += 6
	elif w[0] == 'O':
		count += 8
	elif w[0] == 'D':
		count += 12
	elif w[0] == 'I':
		count += 20
print(count)


n = int(input())
tot = 0
for _ in range(n):
	l = input()
	if l[0] == 'T':
		tot += 4
	elif l[0] == 'C':
		tot += 6
	elif l[0] == 'O':
		tot += 8
	elif l[0] == 'D':
		tot += 12
	else:
		tot += 20
print(tot)


tc = int(input())
faces = 0
for _ in range(tc):
	polyhed = input()
	if polyhed.startswith('T'):
		faces += 4
	elif polyhed.startswith('C'):
		faces += 6
	elif polyhed.startswith('O'):
		faces += 8
	elif polyhed.startswith('D'):
		faces += 12
	elif polyhed.startswith('I'):
		faces += 20
print(faces)


D = dict()
D['Tetrahedron'] = 4
D['Cube'] = 6
D['Octahedron'] = 8
D['Dodecahedron'] = 12
D['Icosahedron'] = 20
ch = input()
k = int(ch)
cmpt = 0
for i in range(0, k):
	a = input()
	cmpt = cmpt + D[a]
print(cmpt)


d = {'Icosahedron': 20, 'Cube': 6, 'Tetrahedron': 4, 'Dodecahedron': 12, 'Octahedron': 8}
n = int(input())
l = []
for i in range(n):
	l.append(input())
sol = 0
for i in range(len(l)):
	if l[i] in d:
		sol = sol + d.get(l[i])
print(sol)


n = int(input())
d = dict()
d['tetra'] = 4
d['cube'] = 6
d['oct'] = 8
d['dod'] = 12
d['ico'] = 20
k = 0
for i in range(n):
	a = input()
	if a == 'Tetrahedron':
		k = k + d['tetra']
	elif a == 'Cube':
		k = k + d['cube']
	elif a == 'Octahedron':
		k = k + d['oct']
	elif a == 'Dodecahedron':
		k = k + d['dod']
	elif a == 'Icosahedron':
		k = k + d['ico']
print(k)


from sys import stdin
inp = stdin.readline
polyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(inp().strip())
faceSum = 0
while n > 0:
	n -= 1
	currentInput = inp().strip()
	faceSum += polyhedrons[currentInput]
print(faceSum)


n = int(input())
polyhedron = []
for i in range(n):
	polyhedron.append(input())
n_cubes = polyhedron.count('Cube')
n_tetrahedron = polyhedron.count('Tetrahedron')
n_Octahedron = polyhedron.count('Octahedron')
n_Dodecahedron = polyhedron.count('Dodecahedron')
n_Icosahedron = polyhedron.count('Icosahedron')
total = 6 * n_cubes + 8 * n_Octahedron + 4 * n_tetrahedron + 12 * n_Dodecahedron + 20 * n_Icosahedron
print(total)


a = int(input())
res = 0
for x in range(a):
	s = str(input())
	if s == 'Tetrahedron':
		res = res + 4
	elif s == 'Cube':
		res = res + 6
	elif s == 'Octahedron':
		res = res + 8
	elif s == 'Dodecahedron':
		res = res + 12
	else:
		res = res + 20
print(res)


log = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
total = 0
for _ in range(n):
	shape = input()
	value = log[shape]
	total += value
print(total)


n = int(input())
l = {'Icosahedron': 20, 'Cube': 6, 'Tetrahedron': 4, 'Dodecahedron': 12, 'Octahedron': 8}
c = 0
for _ in range(n):
	e = input()
	c = c + l[e]
print(c)


Polyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
s = 0
N = int(input())
while N:
	s += Polyhedrons[input()]
	N -= 1
print(s)


x = int(input())
n = []
x1 = []
for i in range(x):
	y = str(input())
	n.append(y)
x1 = n.count('Icosahedron')
x2 = n.count('Cube')
x3 = n.count('Tetrahedron')
x4 = n.count('Dodecahedron')
x5 = n.count('Octahedron')
x6 = x1 * 20 + x2 * 6 + x3 * 4 + x4 * 12 + x5 * 8
print(x6)


import sys
inp = sys.stdin.readline
n = int(inp())
t = 0
a = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(n):
	t += a[inp().rstrip()]
print(t)


points = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
polyhedrons = [input() for i in range(n)]
print(sum([points[x] for x in polyhedrons]))


d = int(input())
f = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
g = [4, 6, 8, 12, 20]
p = 0
for i in range(d):
	this = input()
	p += g[f.index(this)]
print(p)


n = int(input())
i = 0
f = 0
while i < n:
	s = input()
	if s[0] == 'T':
		f += 4
	elif s[0] == 'C':
		f += 6
	elif s[0] == 'O':
		f += 8
	elif s[0] == 'D':
		f += 12
	elif s[0] == 'I':
		f += 20
	i += 1
print(f)


dictt = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
count = 0
li = [input() for i in range(n)]
for i in li:
	if i in dictt:
		count += dictt[i]
print(count)


n = int(input())
count = 0
d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
face = 0
shape_list = []
while count < n:
	k = input()
	shape_list.append(k)
	count += 1
for a in shape_list:
	face += d[a]
print(face)


c = 0
for _ in range(int(input())):
	p = input()
	if p.startswith('I'):
		c += 20
	elif p.startswith('D'):
		c += 12
	elif p.startswith('O'):
		c += 8
	elif p.startswith('C'):
		c += 6
	else:
		c += 4
print(c)


t = int(input())
b = []
while t != 0:
	t -= 1
	s = str(input())
	if s == 'Tetrahedron':
		b.append(4)
	elif s == 'Cube':
		b.append(6)
	elif s == 'Octahedron':
		b.append(8)
	elif s == 'Dodecahedron':
		b.append(12)
	else:
		b.append(20)
print(sum(b))


def count_edge(list_collection):
	a = list_collection.count('Tetrahedron') * 4
	b = list_collection.count('Cube') * 6
	c = list_collection.count('Octahedron') * 8
	d = list_collection.count('Dodecahedron') * 12
	e = list_collection.count('Icosahedron') * 20
	return sum([a, b, c, d, e])
n = int(input())
collection = [input() for i in range(n)]
print(count_edge(collection))


n = int(input())
c = 0
for _ in range(n):
	a = str(input())
	if a == 'Tetrahedron':
		c += 4
	elif a == 'Cube':
		c += 6
	elif a == 'Octahedron':
		c += 8
	elif a == 'Dodecahedron':
		c += 12
	elif a == 'Icosahedron':
		c += 20
print(c)


import sys
inputs = []
for line in sys.stdin:
	inputs.append(line.rstrip())
table = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
total = 0
for i in inputs[1:]:
	side = table[i]
	total += side
print(total)


x = int(input())
count = int()
for i in range(x):
	a = input()
	if a[0] == 'T':
		count = count + 4
	if a[0] == 'C':
		count = count + 6
	if a[0] == 'O':
		count = count + 8
	if a[0] == 'D':
		count = count + 12
	if a[0] == 'I':
		count = count + 20
print(count)


NUM_FACES = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}

def main():
	n = int(input())
	ans = 0
	for i in range(n):
		ans += NUM_FACES[input().strip()]
	print(ans)
main()


a = [['Tetrahedron', 4], ['Cube', 6], ['Octahedron', 8], ['Dodecahedron', 12], ['Icosahedron', 20]]
s = 0
for i in range(int(input())):
	q = input()
	for i in range(5):
		if q == a[i][0]:
			s += a[i][1]
			break
print(s)


n = int(input())
face = 0
for i in range(n):
	e = input()
	if e == 'Tetrahedron':
		face += 4
	elif e == 'Cube':
		face += 6
	elif e == 'Octahedron':
		face += 8
	elif e == 'Dodecahedron':
		face += 12
	else:
		face += 20
print(face)


g = []
l = 0
k = int(input())
for i in range(k):
	j = input()
	g.append(j)
for i in range(k):
	if g[i] == 'Tetrahedron':
		l += 4
	elif g[i] == 'Cube':
		l += 6
	elif g[i] == 'Octahedron':
		l += 8
	elif g[i] == 'Dodecahedron':
		l += 12
	elif g[i] == 'Icosahedron':
		l += 20
print(l)


T = int(input())
l = []
for _ in range(T):
	figure = input()
	if figure == 'Tetrahedron':
		l.append(4)
	elif figure == 'Cube':
		l.append(6)
	elif figure == 'Octahedron':
		l.append(8)
	elif figure == 'Dodecahedron':
		l.append(12)
	elif figure == 'Icosahedron':
		l.append(20)
print(sum(l))


def main(poly, dic):
	sides = 0
	for i in poly:
		sides += dic[i]
	print(sides)
import sys
n = int(input())
poly = []
while n:
	poly.append(str(input()))
	n -= 1
dic = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
sys.exit(main(poly, dic))


t = int(input())
n = t
l = []
sum = 0
while n != 0:
	l.append(input())
	n -= 1
for i in range(t):
	if l[i] == 'Tetrahedron':
		sum = sum + 4
	elif l[i] == 'Cube':
		sum = sum + 6
	elif l[i] == 'Octahedron':
		sum = sum + 8
	elif l[i] == 'Dodecahedron':
		sum = sum + 12
	elif l[i] == 'Icosahedron':
		sum = sum + 20
print(sum)


n = int(input())
ls = [input() for _ in range(n)]
ans = 0
for poly in ls:
	if poly == 'Tetrahedron':
		ans += 4
	elif poly == 'Cube':
		ans += 6
	elif poly == 'Octahedron':
		ans += 8
	elif poly == 'Dodecahedron':
		ans += 12
	elif poly == 'Icosahedron':
		ans += 20
print(ans)


import sys
from itertools import islice
fin = sys.stdin
fout = sys.stdout
lines = (line.strip() for line in fin)
n = int(next(lines))
total = 0
for _ in range(n):
	name = next(lines).lower()
	if name == 'tetrahedron':
		total += 4
	elif name == 'cube':
		total += 6
	elif name == 'octahedron':
		total += 8
	elif name == 'dodecahedron':
		total += 12
	elif name == 'icosahedron':
		total += 20
print(total, file=fout)


t = int(input())
sum1 = 0
while t:
	n = input()
	if n == 'Icosahedron':
		sum1 += 20
	elif n == 'Cube':
		sum1 += 6
	elif n == 'Tetrahedron':
		sum1 += 4
	elif n == 'Dodecahedron':
		sum1 += 12
	elif n == 'Octahedron':
		sum1 += 8
	t -= 1
print(sum1)


n = int(input())
edr = {'Tetrahedron': 0, 'Cube': 0, 'Octahedron': 0, 'Dodecahedron': 0, 'Icosahedron': 0}
for i in range(n):
	edr[input()] += 1
print(edr['Tetrahedron'] * 4 + edr['Cube'] * 6 + edr['Octahedron'] * 8 + edr['Dodecahedron'] * 12 + edr['Icosahedron'] * 20)


n = int(input())
lst = []
for i in range(n):
	shape = input()
	lst.append(shape)
faces = 0
for j in lst:
	if j == 'Tetrahedron':
		faces += 4
	elif j == 'Cube':
		faces += 6
	elif j == 'Octahedron':
		faces += 8
	elif j == 'Dodecahedron':
		faces += 12
	elif j == 'Icosahedron':
		faces += 20
print(faces)


n = int(input())
sides = 0
shape = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for _ in range(n):
	a = input()
	sides += shape[a]
print(sides)


n = int(input())
i = 0
x = []
b = 0
while i < n:
	z = input()
	x.append(z)
	i += 1
dic = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for s in x:
	for v in dic:
		if s == v:
			b += dic[v]
print(b)


strOfShapes = input('')
numOfShapes = int(strOfShapes)
i = 0
sides = 0
while i < numOfShapes:
	getShapes = input('')
	if getShapes == 'Tetrahedron':
		sides = sides + 4
	elif getShapes == 'Cube':
		sides = sides + 6
	elif getShapes == 'Octahedron':
		sides = sides + 8
	elif getShapes == 'Dodecahedron':
		sides = sides + 12
	elif getShapes == 'Icosahedron':
		sides = sides + 20
	else:
		break
	i = i + 1
print(sides)


n = int(input())
s = []
t = str
sum1 = 0
for i in range(n):
	t = str(input())
	s.append(t)
for i in range(len(s)):
	if s[i] == 'Tetrahedron':
		sum1 += 4
	if s[i] == 'Cube':
		sum1 += 6
	if s[i] == 'Octahedron':
		sum1 += 8
	if s[i] == 'Dodecahedron':
		sum1 += 12
	if s[i] == 'Icosahedron':
		sum1 += 20
print(sum1)


n = int(input())
faces = 0
for x in range(n):
	p = input()
	if p == 'Icosahedron':
		faces += 20
	elif p == 'Cube':
		faces += 6
	elif p == 'Tetrahedron':
		faces += 4
	elif p == 'Octahedron':
		faces += 8
	else:
		faces += 12
print(faces)


n = int(input())
ch = 0
granes = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
for i in range(n):
	s = input()[0]
	ch += granes[s]
print(ch)


n = int(input())
figures = []
for i in range(n):
	figures.append(''.join(input()))
print(4 * figures.count('Tetrahedron') + 6 * figures.count('Cube') + 8 * figures.count('Octahedron') + 12 * figures.count('Dodecahedron') + 20 * figures.count('Icosahedron'))


m = int(input())
count = 0
for i in range(m):
	s = input()
	s = s.lower()
	if s == 'tetrahedron':
		count += 4
	elif s == 'cube':
		count += 6
	elif s == 'octahedron':
		count += 8
	elif s == 'dodecahedron':
		count += 12
	elif s == 'icosahedron':
		count += 20
print(count)


n = int(input())
poly = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
pol = [input() for i in range(0, n)]
result = sum((poly[p] for p in pol))
print(result)


t = int(input())
fig = []
for test in range(t):
	fig.append(input())
ans = 0
for i in fig:
	if i == 'Tetrahedron':
		ans += 4
	if i == 'Cube':
		ans += 6
	if i == 'Octahedron':
		ans += 8
	if i == 'Dodecahedron':
		ans += 12
	if i == 'Icosahedron':
		ans += 20
print(ans)


def get_values():
	polyhedrons = {'Cube': 6, 'Icosahedron': 20, 'Tetrahedron': 4, 'Octahedron': 8, 'Dodecahedron': 12}
	num = int(input())
	counter = 0
	for i in range(num):
		hedron = input().capitalize()
		for (key, value) in polyhedrons.items():
			if key == hedron:
				counter += value
	return print(counter)
get_values()


meanings = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
sum = 0
for _ in [0] * int(input()):
	x = input()
	sum += meanings[x]
print(sum)


import re

def main():
	shapes = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	size = int(input())
	sides = 0
	for i in range(size):
		sides += shapes[input()]
	print(sides)
main()


from sys import stdin, stdout
import sys
import math
INF = 1000000000.0

def get_int():
	return int(stdin.readline().strip())

def get_ints():
	return map(int, stdin.readline().strip().split())

def get_array():
	return list(map(int, stdin.readline().strip().split()))

def get_string():
	return stdin.readline().strip()

def op(c):
	return stdout.write(c)
n = get_int()
c = 0
d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(n):
	s = get_string()
	c += d[s]
print(c)


n = int(input())
list_op = []
total_faces = 0
for i in range(n):
	list_op.append(input())
for i in range(n):
	a = list_op[i]
	if a == 'Tetrahedron':
		total_faces += 4
	elif a == 'Cube':
		total_faces += 6
	elif a == 'Octahedron':
		total_faces += 8
	elif a == 'Dodecahedron':
		total_faces += 12
	elif a == 'Icosahedron':
		total_faces += 20
print(total_faces)


class Solution(object):

	def __init__(self):
		self.n = int(input())
		a = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
		b = [4, 6, 8, 12, 20]
		c = dict(zip(a, b))
		ans = 0
		for _ in range(self.n):
			ans += c[input()]
			pass
		print(ans)
	pass
Solution()


no_poly = int(input())
count = 0
for i in range(no_poly):
	shape_name = input()
	if shape_name == 'Tetrahedron':
		count += 4
	if shape_name == 'Cube':
		count += 6
	if shape_name == 'Octahedron':
		count += 8
	if shape_name == 'Dodecahedron':
		count += 12
	if shape_name == 'Icosahedron':
		count += 20
print(count)


def main():
	hash_map = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	n = int(input())
	faces_count = 0
	for _ in range(n):
		faces_count += hash_map[input()]
	print(faces_count)
main()


Icosahedron = 'Icosahedron'
IcosahedronPolygons = 20
Cube = 'Cube'
CubePolygons = 6
Octahedron = 'Octahedron'
OctahedronPolygons = 8
Dodecahedron = 'Dodecahedron'
DodecahedronPolygons = 12
Tetrahedron = 'Tetrahedron'
TetrahedronPolygons = 4
count = int(input())
i = 0
summarPolygons = 0
while i < count:
	figure = input()
	if figure == Icosahedron:
		summarPolygons = summarPolygons + IcosahedronPolygons
	if figure == Cube:
		summarPolygons = summarPolygons + CubePolygons
	if figure == Octahedron:
		summarPolygons = summarPolygons + OctahedronPolygons
	if figure == Dodecahedron:
		summarPolygons = summarPolygons + DodecahedronPolygons
	if figure == Tetrahedron:
		summarPolygons = summarPolygons + TetrahedronPolygons
	i = i + 1
print(summarPolygons)


n = int(input())
p = {'Icosahedron': 20, 'Cube': 6, 'Tetrahedron': 4, 'Octahedron': 8, 'Dodecahedron': 12}
i = 0
faces = 0
while i < 200001 and i < n:
	ph = input()
	faces += p[ph]
	i += 1
print(faces)


POLYHEDRONS = [['Tetrahedron', 4], ['Cube', 6], ['Octahedron', 8], ['Dodecahedron', 12], ['Icosahedron', 20]]
antonPolyhedrons = int(input())
faces = 0
while antonPolyhedrons > 0:
	polyhedron = input()
	for shape in POLYHEDRONS:
		if polyhedron == shape[0]:
			faces = faces + shape[1]
	antonPolyhedrons = antonPolyhedrons - 1
print(faces)


n = int(input())
c = 0
l = list()
for i in range(n):
	a = str(input())
	l.append(a)
	if l[i][0] == 'T':
		c += 4
	elif l[i][0] == 'C':
		c += 6
	elif l[i][0] == 'O':
		c += 8
	elif l[i][0] == 'D':
		c += 12
	elif l[i][0] == 'I':
		c += 20
print(c)


from sys import stdin, setrecursionlimit
setrecursionlimit(10 ** 6)
input = stdin.readline
n = int(input())
anton = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
ans = 0
for _ in range(n):
	ans += anton[input().rstrip()]
print(ans)


x = int(input())
i = 0
b = []
while i < x:
	b.append(input())
	i += 1
a = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
s = 0
for y in b:
	if y in a:
		s += a[y]
print(s)


n = eval(input())
faces = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
k = 0
while n > 0:
	line = input().rstrip()
	k = k + faces[line]
	n -= 1
print(k)


shape_to_faces = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
result = 0
for i in range(n):
	result += shape_to_faces[input()]
print(result)


num = int(input())
Polyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
acu = 0
for i in range(num):
	poly = str(input())
	if poly in Polyhedrons:
		acu += Polyhedrons[poly]
print(acu)


x = int(input())
i = 0
for _ in range(x):
	stronze = input()
	if stronze[0] == 'T':
		i += 4
	elif stronze[0] == 'C':
		i += 6
	elif stronze[0] == 'O':
		i += 8
	elif stronze[0] == 'D':
		i += 12
	elif stronze[0] == 'I':
		i += 20
print(i)


def main():
	length = int(input())
	shapes = {'Tetrahedron': 0, 'Cube': 0, 'Octahedron': 0, 'Dodecahedron': 0, 'Icosahedron': 0}
	for i in range(length):
		shape = input()
		shapes[shape] += 1
	faces_list = [4, 6, 8, 12, 20]
	number = 0
	for ((_, shape), faces) in zip(shapes.items(), faces_list):
		number += shape * faces
	print(number)
main()


n = int(input())
a = []
c = 0
for i in range(0, n):
	t = str(input())
	a.append(t)
for i in range(0, n):
	if a[i] == 'Tetrahedron':
		c = c + 4
	if a[i] == 'Cube':
		c = c + 6
	if a[i] == 'Octahedron':
		c = c + 8
	if a[i] == 'Dodecahedron':
		c = c + 12
	if a[i] == 'Icosahedron':
		c = c + 20
print(c)


import collections
n = int(input())
lt = []
for i in range(n):
	figure = str(input())
	lt.append(figure)
lt = collections.Counter(lt)
num = 0
num += int(lt['Cube']) * 6
num += int(lt['Tetrahedron']) * 4
num += int(lt['Octahedron']) * 8
num += int(lt['Dodecahedron']) * 12
num += int(lt['Icosahedron']) * 20
print(num)


t = int(input())
sum = 0
for _ in range(t):
	s = input()
	if s == 'Icosahedron':
		sum = sum + 20
	if s == 'Cube':
		sum = sum + 6
	if s == 'Tetrahedron':
		sum = sum + 4
	if s == 'Octahedron':
		sum = sum + 8
	if s == 'Dodecahedron':
		sum = sum + 12
print(sum)


line1 = int(input())
poly = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
ins = []
for i in range(line1):
	ins.append(str(input()))
num = 0
for item in ins:
	num += poly[item]
print(num)


p_num = int(input())
summ = 0
for i in range(p_num):
	inp = input()
	if 'Tetrahedron' == inp:
		summ += 4
	elif 'Cube' == inp:
		summ += 6
	elif 'Octahedron' == inp:
		summ += 8
	elif 'Dodecahedron' == inp:
		summ += 12
	else:
		summ += 20
print(summ)


n = int(input())
sides = 0
di = {}
for _ in range(n):
	inp = input()
	if inp not in di:
		di[inp] = 1
	else:
		di[inp] += 1
for (key, val) in di.items():
	if key == 'Tetrahedron':
		sides += val * 4
	elif key == 'Cube':
		sides += val * 6
	elif key == 'Octahedron':
		sides += val * 8
	elif key == 'Dodecahedron':
		sides += val * 12
	elif key == 'Icosahedron':
		sides += val * 20
print(sides)


n = int(input())
arr = []
(i, Sum) = (0, 0)
while i < n:
	ele = input()
	arr.append(ele)
	i = i + 1
for i in range(0, n):
	if arr[i] == 'Icosahedron':
		Sum = Sum + 20
	elif arr[i] == 'Dodecahedron':
		Sum = Sum + 12
	elif arr[i] == 'Tetrahedron':
		Sum = Sum + 4
	elif arr[i] == 'Octahedron':
		Sum = Sum + 8
	else:
		Sum = Sum + 6
print(Sum)


value = int(input())
dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
count = 0
for i in range(value):
	values = input()
	count += dict[values]
print(count)


n = input().split()[0]
n = int(n)
ans = 0
for i in range(n):
	s = input()
	if s[0] == 'I':
		ans += 20
	elif s[0] == 'C':
		ans += 6
	elif s[0] == 'T':
		ans += 4
	elif s[0] == 'D':
		ans += 12
	else:
		ans += 8
print(ans)


a = int(input())
l = []
d = 0
for i in range(a):
	c = input()
	if c == 'Icosahedron':
		d += 20
	elif c == 'Tetrahedron':
		d += 4
	elif c == 'Cube':
		d += 6
	elif c == 'Octahedron':
		d += 8
	elif c == 'Dodecahedron':
		d += 12
print(d)


def main():
	d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	n = int(input())
	count = 0
	for _ in range(n):
		inp = input()
		count += d[inp]
	print(count)
main()


def solve(n, shapes):
	total = 0
	for shape in shapes:
		total += faces_dict[shape]
	print(total)
n = int(input())
shapes = [input()[0:1] for i in range(n)]
faces_dict = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
solve(n, shapes)


def solve():
	n = int(input())
	faces = 0
	for i in range(n):
		s = input()
		if s == 'Tetrahedron':
			faces += 4
		elif s == 'Cube':
			faces += 6
		elif s == 'Octahedron':
			faces += 8
		elif s == 'Dodecahedron':
			faces += 12
		elif s == 'Icosahedron':
			faces += 20
		else:
			print('Wrong input')
			return
	print(faces)
solve()


t = int(input())
sum = 0
for i in range(1, t + 1, 1):
	s = str(input())
	if s == 'Icosahedron':
		sum += 20
	elif s == 'Cube':
		sum += 6
	elif s == 'Tetrahedron':
		sum += 4
	elif s == 'Dodecahedron':
		sum += 12
	elif s == 'Octahedron':
		sum += 8
print(sum)


face = {'tetrahedron': 4, 'cube': 6, 'octahedron': 8, 'dodecahedron': 12, 'icosahedron': 20}
n = int(input())
total = 0
for i in range(n):
	name = input().lower()
	if name in face.keys():
		total += face[name]
print(total)


n = int(input())
polyhedrons = (input()[0] for _ in range(n))
faces = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
print(sum((faces[p] for p in polyhedrons)))


first_num = int(input())
shapes = []
for i in range(first_num):
	shapes.append(input())
total_faces = 0
for shape in shapes:
	if shape[0] == 'T':
		total_faces += 4
	elif shape[0] == 'C':
		total_faces += 6
	elif shape[0] == 'O':
		total_faces += 8
	elif shape[0] == 'D':
		total_faces += 12
	else:
		total_faces += 20
print(total_faces)


F = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
kol = int(input())
z = 0
for i in range(kol):
	x = input()
	z += F[x]
print(z)


n = int(input())
s = 0
l = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
x = [4, 6, 8, 12, 20]
for i in range(n):
	m = input()
	s += x[l.index(m)]
print(s)


n = int(input())
polyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
faces = 0
i = 0
while i < n:
	s = input()
	faces += polyhedrons[s]
	i += 1
print(faces)


import sys
dicts = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for s in sys.stdin:
	ans = 0
	for i in range(0, int(s)):
		ans += dicts.get(input())
	print(ans)


n = int(input(''))
i = 1
output = 0
while i <= n:
	ith = input('').title()
	if ith == 'Tetrahedron':
		output = output + 4
	elif ith == 'Cube':
		output = output + 6
	elif ith == 'Octahedron':
		output = output + 8
	elif ith == 'Dodecahedron':
		output = output + 12
	elif ith == 'Icosahedron':
		output = output + 20
	i += 1
print(output)


n = int(input())
arr = [input() for i in range(n)]
T = arr.count('Tetrahedron') * 4
C = arr.count('Cube') * 6
O = arr.count('Octahedron') * 8
D = arr.count('Dodecahedron') * 12
I = arr.count('Icosahedron') * 20
print(T + C + D + O + I)


from sys import stdin
mapping = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
count = 0
for i in range(n):
	shape = stdin.readline()
	count += mapping[shape[:-1]]
print(count)


d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
t = int(input())
suM = 0
for _ in range(t):
	suM += d[input()]
print(suM)


import sys

def main():
	d = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
	_sum = 0
	n = int(input())
	for i in range(n):
		figure = input()
		_sum += d[figure[0]]
	print(_sum)
sys.exit(main())


_1 = '236a'
_2 = '339a'
_3 = '266a'
_4 = '96a'
_5 = '236a'
_6 = '281a'
_7 = '546a'
_8 = '116a'
_9 = '977a'
_10 = '266b'
_11 = '110a'
_12 = '41a'
_13 = '734a'
_14 = '133a'
_15 = '467a'
_16 = '158a'
_17 = '677a'
_18 = '580a'
_19 = '344a'
_20 = '1030a'
_21 = '705a'
_22 = '318a'
_23 = '479a'
_24 = '486a'
_25 = '61a'
_26 = '405a'
_27 = '200b'
_28 = '337a'
_29 = '148a'
_30 = '228a'
_31 = '25a'
_32 = '25a'
_33 = '1328a'
_34 = '785a'
n = int(input())
c = 0
for i in range(n):
	t = str(input())
	if t == 'Tetrahedron':
		c += 4
	elif t == 'Icosahedron':
		c += 20
	elif t == 'Cube':
		c += 6
	elif t == 'Octahedron':
		c += 8
	elif t == 'Dodecahedron':
		c += 12
print(c)


def solve(n):
	faces = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	total = 0
	for i in range(n):
		shape = input()
		total += faces[shape]
	return total
n = int(input())
answer = solve(n)
print(answer)


polyhedrons = []
resultValue = 0
polyhedronValues = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
amount = int(input())
for i in range(0, amount):
	polyhedrons.append(input())
for shape in polyhedrons:
	resultValue += polyhedronValues[shape]
print(resultValue)


math = {4: 'Tetrahedron', 6: 'Cube', 8: 'Octahedron', 12: 'Dodecahedron', 20: 'Icosahedron'}
r = int(0)
n = int(input())
for i in range(n):
	s = input()
	for j in range(21):
		if s == math.get(j):
			r += j
print(r)


def polyhedrons():
	polygons = dict({'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20})
	points = []
	for i in range(int(input())):
		val = polygons.get(input())
		points.append(val)
	return sum(points)
print(polyhedrons())


n = int(input())
cnt = 0
dron = [['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron'], [4, 6, 8, 12, 20]]
for i in range(n):
	a = input()
	for j in range(5):
		if dron[0][j] == a:
			cnt += dron[1][j]
			break
print(cnt)


a = int(input())
x = []
i = 0
z = 0
while i < a:
	d = input()
	x.append(d)
	i += 1
t = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for w in t:
	for q in x:
		if w == q:
			z += t[w]
print(z)


ans = 0
mmp = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
T = int(input())
for _ in range(T):
	s = input()
	ans += mmp[s]
print(ans)


n = int(input())
total = 0
s = []
for i in range(n):
	st = input()
	s.append(st)
for i in range(n):
	if s[i] == 'Tetrahedron':
		total += 4
	if s[i] == 'Cube':
		total += 6
	if s[i] == 'Octahedron':
		total += 8
	if s[i] == 'Dodecahedron':
		total += 12
	if s[i] == 'Icosahedron':
		total += 20
print(total)


import sys
n = int(input())
res = 0
for i in range(n):
	shape = sys.stdin.readline()[:-1]
	if shape == 'Tetrahedron':
		res += 4
	elif shape == 'Cube':
		res += 6
	elif shape == 'Octahedron':
		res += 8
	elif shape == 'Dodecahedron':
		res += 12
	elif shape == 'Icosahedron':
		res += 20
print(res)


dic = {}
dic['Tetrahedron'] = 4
dic['Cube'] = 6
dic['Octahedron'] = 8
dic['Dodecahedron'] = 12
dic['Icosahedron'] = 20
r = 0
for _ in range(int(input())):
	t = input()
	if t[-1] == '\r':
		t = t[:-1]
	r += dic[t]
print(r)


l1 = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
l2 = [4, 6, 8, 12, 20]
sum1 = 0
for _ in range(int(input())):
	s = input()
	sum1 += l2[l1.index(s)]
print(sum1)


faces_dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
faces = 0
input_arr = []
n = int(input())
for _ in range(n):
	poly = input()
	input_arr.append(poly)
for poly in input_arr:
	faces += faces_dict[poly]
print(faces)


class Main:
	polyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	antons_polys = []
	n = int(input())
	for i in range(1, n + 1):
		antons_polys.append(input())
	faces = 0
	for poly in antons_polys:
		faces += polyhedrons[poly]
	print(faces)
Main()


t = int(input())
c = 0
for i in range(t):
	s = list(input())
	if s[0] == 'I':
		c += 20
	elif s[0] == 'O':
		c += 8
	elif s[0] == 'D':
		c += 12
	elif s[0] == 'C':
		c += 6
	elif s[0] == 'T':
		c += 4
print(c)


a = int(input())
no_of_lines = a
lines = ''
for i in range(a):
	lines += input() + '\n'
b = lines.split()
x = b.count('Tetrahedron')
y = b.count('Cube')
z = b.count('Octahedron')
w = b.count('Dodecahedron')
q = b.count('Icosahedron')
print(int(4 * x + 6 * y + 8 * z + 12 * w + 20 * q))


polyDict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
(t, sum) = (int(input()), 0)
for i in range(0, t):
	sum += polyDict[input()]
print(sum)


x = int(input())
lst = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
lst1 = [4, 6, 8, 12, 20]
z = 0
while x != 0:
	y = input()
	z = z + lst1[lst.index(y)]
	x = x - 1
print(z)


shapes = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
num = int(input())
result = sum((shapes[input()] for _ in range(num)))
print(result)


test = int(input())
shapes = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
total = 0
for t in range(0, test):
	size = input()
	total = total + shapes[size]
print(total)


a = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
s = []
z = int(input())
for i in range(z):
	s.append(input())
sd = 0
for i in s:
	if i in a:
		sd += a[i]
print(sd)


testCase = int(input())
side = 0
for i in range(testCase):
	s = input()
	if s == 'Tetrahedron':
		side += 4
	elif s == 'Cube':
		side += 6
	elif s == 'Octahedron':
		side += 8
	elif s == 'Dodecahedron':
		side += 12
	elif s == 'Icosahedron':
		side += 20
print(side)


x = int(input())
z = 0
tet_c = cube_c = oct_c = dode_c = ic_c = 0
for i in range(x):
	p = input()
	p = p[0]
	if p == 'T':
		tet_c += 1
	elif p == 'C':
		cube_c += 1
	elif p == 'O':
		oct_c += 1
	elif p == 'D':
		dode_c += 1
	elif p == 'I':
		ic_c += 1
print(tet_c * 4 + cube_c * 6 + oct_c * 8 + dode_c * 12 + ic_c * 20)


input_s = int(input())
result = 0
for i in range(input_s):
	input_l = input()
	if input_l == 'Tetrahedron':
		result += 4
	elif input_l == 'Cube':
		result += 6
	elif input_l == 'Octahedron':
		result += 8
	elif input_l == 'Dodecahedron':
		result += 12
	elif input_l == 'Icosahedron':
		result += 20
print(result)


import time

def calcFacesPolyhedrons(polysColl):
	nfaces = 0
	for poly in polysColl:
		if poly == 'Tetrahedron':
			nfaces += 4
		if poly == 'Cube':
			nfaces += 6
		if poly == 'Octahedron':
			nfaces += 8
		if poly == 'Dodecahedron':
			nfaces += 12
		if poly == 'Icosahedron':
			nfaces += 20
	return nfaces

def solve():
	numPolys = int(input())
	polys = []
	for x in range(numPolys):
		polys.append(input())
	print(calcFacesPolyhedrons(polys))
solve()


Tetrahedron = 4
Cube = 4
Octahedron = 8
Dodecahedron = 12
Icosahedron = 20
li = []
x = int(input())
for i in range(x):
	z = input()
	li.append(z)
for i in range(x):
	if li[i] == 'Tetrahedron':
		li[i] = 4
	elif li[i] == 'Octahedron':
		li[i] = 8
	elif li[i] == 'Cube':
		li[i] = 6
	elif li[i] == 'Dodecahedron':
		li[i] = 12
	elif li[i] == 'Icosahedron':
		li[i] = 20
t = sum(li)
print(t)


total = 0
fig = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
faces = [4, 6, 8, 12, 20]
for _ in range(int(input())):
	stri = input()
	total += faces[fig.index(stri)]
print(total)


total = int(input())
shapes = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
result = 0
for case in range(total):
	shape = input()
	result += shapes[shape]
print(result)


cases = int(input())
faces = 0
for i in range(cases):
	shape = input()
	if shape == 'Tetrahedron':
		faces = faces + 4
	elif shape == 'Cube':
		faces = faces + 6
	elif shape == 'Octahedron':
		faces = faces + 8
	elif shape == 'Dodecahedron':
		faces = faces + 12
	elif shape == 'Icosahedron':
		faces = faces + 20
print(faces)


n = int(input())
shapes = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
total = 0
strings = []
if 1 <= n and n <= 200000:
	strings = [str(input()) for i in range(n)]
for string in strings:
	for (key, value) in shapes.items():
		if string == key:
			total += value
print(total)


n = eval(input())
count = 0
z = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
for i in range(n):
	a = input()
	if z.index(a) == 0:
		count = count + 4
	if z.index(a) == 1:
		count = count + 6
	if z.index(a) == 2:
		count = count + 8
	if z.index(a) == 3:
		count = count + 12
	if z.index(a) == 4:
		count = count + 20
print(count)


n = int(input())
ans = 0
while n:
	n = n - 1
	s = input()
	if s == 'Tetrahedron':
		ans = ans + 4
	elif s == 'Cube':
		ans = ans + 6
	elif s == 'Octahedron':
		ans = ans + 8
	elif s == 'Dodecahedron':
		ans = ans + 12
	elif s == 'Icosahedron':
		ans = ans + 20
	else:
		continue
print(ans)


t = int(input())
cnt = int()
d = {'tetrahedron': 4, 'cube': 6, 'octahedron': 8, 'dodecahedron': 12, 'icosahedron': 20}
for i in range(t):
	s = input()
	if s.lower() in d:
		cnt += d[s.lower()]
print(cnt)


faces_poly = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
total_faces = 0
num_poly = int(input())
for _ in range(num_poly):
	poly = input()
	total_faces += faces_poly[poly]
print(total_faces)


input_string = int(input())
k = 0
list_figure = []
figures = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(input_string):
	input_figure = input()
	list_figure.append(input_figure)
for i in list_figure:
	k += figures[i]
print(k)


import sys
line = int(sys.stdin.readline().strip())
res = []
for i in range(line):
	name = sys.stdin.readline().strip()
	res.append(name)
faces = res.count('Tetrahedron') * 4 + res.count('Cube') * 6 + res.count('Octahedron') * 8 + res.count('Dodecahedron') * 12 + res.count('Icosahedron') * 20
print(faces)


dic = {'Icosahedron': 20, 'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12}
tot = 0
n = int(input())
if n >= 1 and n <= 200000:
	for x in range(n):
		a = input()
		tot += dic[a]
	print(tot)


ans = 0
for f in range(int(input())):
	s = input()
	if s[0] == 'T':
		ans += 4
	elif s[0] == 'C':
		ans += 6
	elif s[0] == 'O':
		ans += 8
	elif s[0] == 'D':
		ans += 12
	else:
		ans += 20
print(ans)


a = int(input())
ans = 0
while a > 0:
	s = input()
	if s == 'Icosahedron':
		ans = ans + 20
	if s == 'Tetrahedron':
		ans = ans + 4
	if s == 'Cube':
		ans = ans + 6
	if s == 'Octahedron':
		ans = ans + 8
	if s == 'Dodecahedron':
		ans = ans + 12
	a = a - 1
print(ans)


n = int(input())
col = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
res = 0
while n > 0:
	line = input()
	res += col[line]
	n -= 1
print(res)


t = int(input())
sum = 0
for i in range(t):
	s = input()
	if s[:3] == 'Tet':
		sum += 4
	elif s[:3] == 'Cub':
		sum += 6
	elif s[:3] == 'Oct':
		sum += 8
	elif s[:3] == 'Dod':
		sum += 12
	elif s[:3] == 'Ico':
		sum += 20
print(sum)


while True:
	n = int(input())
	if n >= 1 and n <= 200000:
		break
sum_face = 0
for i in range(n):
	element = input()
	if element == 'Tetrahedron':
		sum_face += 4
	elif element == 'Cube':
		sum_face += 6
	elif element == 'Octahedron':
		sum_face += 8
	elif element == 'Dodecahedron':
		sum_face += 12
	else:
		sum_face += 20
print(sum_face)


Dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
total = 0
for i in range(int(input())):
	total += Dict[input()]
print(total)


cases = input()
di = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
sol = 0
figs = []
for case in range(int(cases)):
	a = input()
	sol += di[a]
print(sol)


n = int(input())
cnt = 0
while n > 0:
	n -= 1
	str = input()
	if str[0] == 'T':
		cnt += 4
	elif str[0] == 'C':
		cnt += 6
	elif str[0] == 'O':
		cnt += 8
	elif str[0] == 'D':
		cnt += 12
	elif str[0] == 'I':
		cnt += 20
print(cnt)


def count_faces(polyhedrons):
	dictionary = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	faces = [polyhedrons[key] * dictionary[key] for key in polyhedrons.keys()]
	return sum(faces)

def main():
	n = int(input())
	polyhedrons_collection = {}
	for _ in range(n):
		p = input()
		if p in polyhedrons_collection:
			polyhedrons_collection[p] += 1
		else:
			polyhedrons_collection[p] = 1
	print(count_faces(polyhedrons_collection))
main()


A = int(input())
count = 0
for i in range(A):
	b = input()
	if b == 'Tetrahedron':
		count += 4
	elif b == 'Cube':
		count += 6
	elif b == 'Octahedron':
		count += 8
	elif b == 'Dodecahedron':
		count += 12
	elif b == 'Icosahedron':
		count += 20
print(count)


n = int(input())
i = int(0)
inputs = []
x = []
while i < n:
	inputGeo = input()
	inputs.append(inputGeo)
	i += 1
dico = {'Tetrahedron': '4', 'Cube': '6', 'Octahedron': '8', 'Dodecahedron': '12', 'Icosahedron': '20'}
for i in inputs:
	a = int(dico.get(i))
	x.append(a)
somme = sum(x)
print(somme)


num = int(input())
total = 0
for i in range(0, num):
	a = str(input())
	if a == 'Tetrahedron':
		total += 4
	elif a == 'Cube':
		total += 6
	elif a == 'Octahedron':
		total += 8
	elif a == 'Dodecahedron':
		total += 12
	elif a == 'Icosahedron':
		total += 20
	else:
		print('SHAPE NOT FOUND!')
print(total)


tests = int(input())
f = 0
for _ in range(tests):
	n = input()
	if n == 'Tetrahedron':
		f += 4
	if n == 'Cube':
		f += 6
	if n == 'Octahedron':
		f += 8
	if n == 'Dodecahedron':
		f += 12
	if n == 'Icosahedron':
		f += 20
print(f)


def check(x):
	if x == 'Tetrahedron':
		return 4
	if x == 'Cube':
		return 6
	if x == 'Octahedron':
		return 8
	if x == 'Dodecahedron':
		return 12
	if x == 'Icosahedron':
		return 20
n = int(input())
sum = 0
for i in range(n):
	x = input()
	sum += check(x)
print(sum)


r = lambda : map(int, input().split())
n = list(r())[0]
c = 0
s = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
while n:
	c += s[input().strip()]
	n -= 1
print(c)


import sys
n = input()
n = int(n)
a = []
for i in range(0, n):
	t = input()
	a.append(t)
f = 0
for i in range(0, n):
	t = a[i]
	if t == 'Tetrahedron':
		f = f + 4
	if t == 'Cube':
		f = f + 6
	if t == 'Octahedron':
		f = f + 8
	if t == 'Dodecahedron':
		f = f + 12
	if t == 'Icosahedron':
		f = f + 20
print(f)


n = int(input())
ans = 0
for i in range(n):
	s = input().lower()[0]
	if s == 't':
		ans += 4
	elif s == 'c':
		ans += 6
	elif s == 'o':
		ans += 8
	elif s == 'd':
		ans += 12
	else:
		ans += 20
print(ans)


n = int(input())
summ = 0
d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for _ in range(n):
	s = input()
	for (x, y) in d.items():
		if x == s:
			summ += y
print(summ)


total = 0
n = int(input())
dict1 = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for x in range(n):
	w = input()
	total += dict1[w]
print(total)


import sys, math, string
input = sys.stdin.readline
L = lambda : list(map(int, input().split()))
M = lambda : map(int, input().split())
d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
c = 0
for i in range(n):
	c += d[input().strip()]
print(c)


n = int(input())
lst = []
for i in range(n):
	lst.append(input())
count = 0
diction = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(len(lst)):
	x = diction.get(lst[i])
	count += x
print(count)


n = int(input())
dico = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
inc = 0
for x in range(n):
	s = input()
	inc += dico[s]
print(inc)


v1 = list('TCODI')
v = [4, 6, 8, 12, 20]
d = {}
for i in range(5):
	d[v1[i]] = v[i]
ans = 0
for i in range(int(input())):
	ans += d[input()[0]]
print(ans)


n = int(input())
c = 0
for x in range(1, n + 1):
	obj = input()
	if obj == 'Tetrahedron':
		c += 4
	elif obj == 'Cube':
		c += 6
	elif obj == 'Octahedron':
		c += 8
	elif obj == 'Dodecahedron':
		c += 12
	else:
		c += 20
print(c)


n = int(input())
ans = 0
for i in range(n):
	s = input()
	if s[0:1] == 'T':
		ans += 4
	if s[0:1] == 'C':
		ans += 6
	if s[0:1] == 'O':
		ans += 8
	if s[0:1] == 'D':
		ans += 12
	if s[0:1] == 'I':
		ans += 20
print(ans)


data_dict = {}
data_dict['Tetrahedron'] = 4
data_dict['Cube'] = 6
data_dict['Octahedron'] = 8
data_dict['Dodecahedron'] = 12
data_dict['Icosahedron'] = 20
number_of_polyhedrons = int(input())
list_of_polyhedrons = []
i = 1
while i <= number_of_polyhedrons:
	l = input()
	if l:
		list_of_polyhedrons.append(l)
	else:
		break
	i += 1

def get_count(list_of_polyhedrons):
	result = 0
	for polyhedron in list_of_polyhedrons:
		result = result + int(data_dict.get(polyhedron))
	return result
print(get_count(list_of_polyhedrons))


a = int(input())
T = 4
C = 6
O = 8
D = 12
I = 20
k = 0
for i in range(a):
	a = input()
	if a == 'Tetrahedron':
		k += T
	elif a == 'Cube':
		k += C
	elif a == 'Octahedron':
		k += O
	elif a == 'Dodecahedron':
		k += D
	elif a == 'Icosahedron':
		k += I
print(k)


inpt = int(input())
typ = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
val = [4, 6, 8, 12, 20]
ls = []
for i in range(inpt):
	ls.append(input())
temp = 0
for i in range(len(ls)):
	indx = typ.index(ls[i])
	temp += val[indx]
print(temp)


n = int(input())
poly = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
total = 0
for _ in range(n):
	total += poly[input()[0]]
print(total)


z = []
for i in ' ' * int(input()):
	a = input()
	if a == 'Tetrahedron':
		z.append(4)
	elif a == 'Cube':
		z.append(6)
	elif a == 'Octahedron':
		z.append(8)
	elif a == 'Dodecahedron':
		z.append(12)
	elif a == 'Icosahedron':
		z.append(20)
print(sum(z))


n = int(input())
a = [4, 6, 8, 12, 20]
b = []
s = 0
for i in range(n):
	x = input()
	b.append(x)
for i in b:
	if i == 'Tetrahedron':
		s = s + a[0]
	elif i == 'Cube':
		s = s + a[1]
	elif i == 'Octahedron':
		s = s + a[2]
	elif i == 'Dodecahedron':
		s = s + a[3]
	elif i == 'Icosahedron':
		s = s + a[4]
print(s)


n = int(input())
my_dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
total = 0
for i in range(n):
	figure = input()
	total += my_dict[figure]
print(total)


Figures = int(input())
Polyhedron = ''
Sides = 0
for i in range(Figures):
	Polyhedron = input()
	if Polyhedron == 'Tetrahedron':
		Sides += 4
	elif Polyhedron == 'Cube':
		Sides += 6
	elif Polyhedron == 'Octahedron':
		Sides += 8
	elif Polyhedron == 'Dodecahedron':
		Sides += 12
	elif Polyhedron == 'Icosahedron':
		Sides += 20
print(Sides)


n = int(input())
data = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
out = 0
for i in range(n):
	out += data[input().strip()]
print(out)


faces = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
tot_faces = 0
for i in range(n):
	curr_shape = input().strip()
	tot_faces += faces[curr_shape]
print(tot_faces)


number = int(input())
counter = 0
for n in range(number):
	name = input()
	if name == 'Tetrahedron':
		counter = counter + 4
	elif name == 'Cube':
		counter = counter + 6
	elif name == 'Octahedron':
		counter = counter + 8
	elif name == 'Dodecahedron':
		counter = counter + 12
	elif name == 'Icosahedron':
		counter = counter + 20
print(counter)


class Solution:

	def getNumOfFaces(self, string):
		my_dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
		return my_dict[string]
sol = Solution()
t = int(input().strip())
mSum = 0
for i in range(t):
	string = input().strip()
	mSum += sol.getNumOfFaces(string)
print(mSum)


number = int(input())
sum = 0
for i in range(number):
	figure = str(input())
	if figure == 'Tetrahedron':
		sum += 4
	elif figure == 'Cube':
		sum += 6
	elif figure == 'Octahedron':
		sum += 8
	elif figure == 'Dodecahedron':
		sum += 12
	elif figure == 'Icosahedron':
		sum += 20
print(sum)


gran_num = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
gr = 0
n = int(input())
for i in range(n):
	grannik = input()
	gr += gran_num[grannik]
print(gr)


x = input()
i = int(x)
total = 0
while i != 0:
	y = input()
	if y == 'Tetrahedron':
		total += 4
	if y == 'Cube':
		total += 6
	if y == 'Octahedron':
		total += 8
	if y == 'Dodecahedron':
		total += 12
	if y == 'Icosahedron':
		total += 20
	i -= 1
print(total)


sum = 0
d = int(input())
for i in range(0, d):
	c = input()
	if c == 'Tetrahedron':
		sum = sum + 4
	elif c == 'Cube':
		sum = sum + 6
	elif c == 'Octahedron':
		sum = sum + 8
	elif c == 'Dodecahedron':
		sum = sum + 12
	else:
		sum = sum + 20
print(sum)


forms = []
x = 0
count = int(input(''))
while x < count:
	forms.append(input(''))
	x += 1
total = 0
_FORM = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for form in forms:
	total += _FORM[form]
print(total)


polyHedron = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
print(sum((polyHedron[input()] for _ in '*' * n)))


import sys
n = int(input())
polygon = list()
for i in range(n):
	polygon.append(input())
result = polygon.count('Tetrahedron') * 4 + polygon.count('Cube') * 6 + polygon.count('Octahedron') * 8 + polygon.count('Dodecahedron') * 12 + polygon.count('Icosahedron') * 20
print(result)


l = int(input())
f = 0
for _ in range(l):
	inp = input()
	if inp == 'Tetrahedron':
		f = f + 4
	elif inp == 'Cube':
		f = f + 6
	elif inp == 'Octahedron':
		f = f + 8
	elif inp == 'Dodecahedron':
		f = f + 12
	elif inp == 'Icosahedron':
		f = f + 20
print(f)


from sys import stdout, stdin
mapping = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
n = int(input())
total = 0
for _ in range(n):
	fig = stdin.readline()
	total += mapping[fig[0]]
stdout.write(str(total))


n = int(input())
grab = 0
s2 = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(1, n + 1):
	str = input()
	grab += s2.get(str)
print(grab)


n = int(input())
sum = 0
for i in range(n):
	t = input()
	dict = {'Icosahedron': 20, 'Cube': 6, 'Tetrahedron': 4, 'Dodecahedron': 12, 'Octahedron': 8}
	for (key, values) in dict.items():
		if t == key:
			sum += dict[key]
print(sum)


a = int(input())
faces = 0
my_dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in range(a):
	key = input()
	if key in my_dict:
		faces += my_dict[key]
print(faces)


nmbrPolyhedrons = int(input())
nbrfaces = 0
for i in range(0, nmbrPolyhedrons):
	polyhedron = input()
	if polyhedron == 'Tetrahedron':
		nbrfaces += 4
	elif polyhedron == 'Cube':
		nbrfaces += 6
	elif polyhedron == 'Octahedron':
		nbrfaces += 8
	elif polyhedron == 'Dodecahedron':
		nbrfaces += 12
	elif polyhedron == 'Icosahedron':
		nbrfaces += 20
print(nbrfaces)


n = int(input())
mapa_polyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
caras = 0
for _ in range(n):
	caras += mapa_polyhedrons[input()]
print(caras)


n = int(input())
p = []
for i in range(0, n):
	m = list(input())
	k = ''
	l = k.join(m)
	p.append(l)
j = []
for i in range(0, n):
	if p[i] == 'Tetrahedron':
		r = 4
		j.append(r)
	elif p[i] == 'Cube':
		r = 6
		j.append(r)
	elif p[i] == 'Octahedron':
		r = 8
		j.append(r)
	elif p[i] == 'Dodecahedron':
		r = 12
		j.append(r)
	elif p[i] == 'Icosahedron':
		r = 20
		j.append(r)
print(sum(j))


getInput = int(input())
value = 0
for i in range(getInput):
	face = input()
	if face == 'Tetrahedron':
		value += 4
	elif face == 'Cube':
		value += 6
	elif face == 'Octahedron':
		value += 8
	elif face == 'Dodecahedron':
		value += 12
	elif face == 'Icosahedron':
		value += 20
print(value)


i = int(input())
l = [input() for o in range(i)]
faces = 0
for x in range(i):
	if l[x] == 'Tetrahedron':
		faces = faces + 4
	elif l[x] == 'Cube':
		faces = faces + 6
	elif l[x] == 'Octahedron':
		faces = faces + 8
	elif l[x] == 'Dodecahedron':
		faces = faces + 12
	elif l[x] == 'Icosahedron':
		faces = faces + 20
print(faces)


n = int(input())
k = 0
i = 0
while i != n:
	x = str(input())
	if x[0] == 'T':
		k += 4
	if x[0] == 'C':
		k += 6
	if x[0] == 'O':
		k += 8
	if x[0] == 'D':
		k += 12
	if x[0] == 'I':
		k += 20
	i += 1
print(k)


d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
count = 0
test = int(input())
for i in range(test):
	s = input()
	if s in d.keys():
		count += d[s]
print(count)


n = int(input())
faces_cnt = 0
for i in range(n):
	figure_name = input()
	if figure_name == 'Tetrahedron':
		faces_cnt += 4
	elif figure_name == 'Cube':
		faces_cnt += 6
	elif figure_name == 'Octahedron':
		faces_cnt += 8
	elif figure_name == 'Dodecahedron':
		faces_cnt += 12
	elif figure_name == 'Icosahedron':
		faces_cnt += 20
print(faces_cnt)


import math
import itertools

def ria():
	return [int(i) for i in input().split()]
mp = {'tetrahedron': 4, 'cube': 6, 'octahedron': 8, 'dodecahedron': 12, 'icosahedron': 20}
sz = ria()[0]
suma = 0
for i in range(sz):
	suma += mp[str(input()).lower()]
print(suma)


from sys import stdin, stdout
n = int(stdin.readline())
names = [stdin.readline().rstrip() for i in range(n)]
m = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
s = sum((m[n] for n in names))
stdout.write(str(s) + '\n')


from functools import reduce
n = int(input())
elements = [input() for _ in range(n)]
poly = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
print(sum([poly[i] for i in elements]))


polyhendrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
suma = 0
n = int(input())
for i in range(n):
	name = str(input())
	suma += polyhendrons[name]
print(suma)


def get_number_of_sides(poly_type):
	if poly_type.strip().upper() == 'TETRAHEDRON':
		return 4
	elif poly_type.strip().upper() == 'CUBE':
		return 6
	elif poly_type.strip().upper() == 'OCTAHEDRON':
		return 8
	elif poly_type.strip().upper() == 'DODECAHEDRON':
		return 12
	elif poly_type.strip().upper() == 'ICOSAHEDRON':
		return 20
n = int(input())
num_sides = 0
for i in range(n):
	current_type = input()
	num_sides += get_number_of_sides(current_type)
print(num_sides)


n = int(input())
a = {}
a['Icosahedron'] = 20
a['Tetrahedron'] = 4
a['Cube'] = 6
a['Octahedron'] = 8
a['Dodecahedron'] = 12
sm = 0
for i in range(0, n):
	ss = input('')
	sm += a[ss]
print(sm)


import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush, nlargest, nsmallest, _heapify_max, _heapreplace_max
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as c
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from fractions import Fraction
mod = pow(10, 9) + 7
mod2 = 998244353

def data():
	return sys.stdin.readline().strip()

def out(*var, end='\n'):
	sys.stdout.write(' '.join(map(str, var)) + end)

def l():
	return list(sp())

def sl():
	return list(ssp())

def sp():
	return map(int, data().split())

def ssp():
	return map(str, data().split())

def l1d(n, val=0):
	return [val for i in range(n)]

def l2d(n, m, val=0):
	return [l1d(n, val) for j in range(m)]
d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
answer = 0
for _ in range(int(data())):
	answer += d[data()]
out(answer)


n = int(input())
k = []
for j in range(n):
	k.append(input())
total = 0
for i in k:
	if i == 'Tetrahedron':
		total += 4
	elif i == 'Cube':
		total += 6
	elif i == 'Octahedron':
		total += 8
	elif i == 'Dodecahedron':
		total += 12
	else:
		total += 20
print(total)


x = {'Icosahedron': 20, 'Cube': 6, 'Tetrahedron': 4, 'Dodecahedron': 12, 'Octahedron': 8}
re = int(input())
res = 0
for i in range(re):
	thing = input()
	q = x.get(thing)
	res = res + q
print(res)


n = int(input())
arr = []
face = 0
for i in range(n):
	arr.append(input())
for word in arr:
	if word == 'Tetrahedron':
		face += 4
	if word == 'Cube':
		face += 6
	if word == 'Octahedron':
		face += 8
	if word == 'Dodecahedron':
		face += 12
	if word == 'Icosahedron':
		face += 20
print(face)


t = 20
c = 6
o = 8
d = 12
i = 20
sums = 0
n = int(input())
for i in range(n):
	a = input()
	if a == 'Tetrahedron':
		sums += 4
	if a == 'Cube':
		sums += 6
	if a == 'Octahedron':
		sums += 8
	if a == 'Dodecahedron':
		sums += 12
	if a == 'Icosahedron':
		sums += 20
print(sums)


x = int(input())
kol = 0
for z in range(x):
	data = input()
	if data == 'Tetrahedron':
		kol += 4
	elif data == 'Cube':
		kol += 6
	elif data == 'Octahedron':
		kol += 8
	elif data == 'Dodecahedron':
		kol += 12
	else:
		kol += 20
print(kol)


number = 0
n = int(input())
print()
for x in range(1, n + 1):
	x = input()
	if x == 'Tetrahedron':
		number += 4
	if x == 'Cube':
		number += 6
	if x == 'Octahedron':
		number += 8
	if x == 'Dodecahedron':
		number += 12
	if x == 'Icosahedron':
		number += 20
print(number)


n = int(input())
res = 0
for i in range(n):
	shape = input()
	if shape == 'Icosahedron':
		res += 20
	elif shape == 'Dodecahedron':
		res += 12
	elif shape == 'Octahedron':
		res += 8
	elif shape == 'Cube':
		res += 6
	else:
		res += 4
print(res)


import sys
n = int(sys.stdin.readline())
ans = 0
hashmap = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for _ in range(n):
	ans += hashmap[sys.stdin.readline().strip()]
print(ans)


GEO_DICT = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
inp = int(input())
faces = 0
for i in range(0, inp):
	faces += GEO_DICT[input()]
print(faces)


data = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
numData = int(input())
count = 0
for _ in range(numData):
	count += data[input()]
print(count)


sum1 = 0
for _ in range(int(input())):
	n = input()
	if n[0] == 'I':
		sum1 += 20
	elif n[0] == 'T':
		sum1 += 4
	elif n[0] == 'O':
		sum1 += 8
	elif n[0] == 'D':
		sum1 += 12
	elif n[0] == 'T':
		sum1 += 4
	else:
		sum1 += 6
print(sum1)


quantity = int(input())
h = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
total = 0
for i in range(quantity):
	a = input()
	total += h[a]
print(total)


poly_dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}

def main():
	n = int(input())
	total = 0
	for i in range(n):
		total += poly_dict[input()]
	print(total)
main()


n = int(input())
c = 0
for i in range(n):
	s = input()
	if s.lower() == 'tetrahedron':
		c += 4
	elif s.lower() == 'cube':
		c = c + 6
	elif s.lower() == 'octahedron':
		c += 8
	elif s.lower() == 'dodecahedron':
		c += 12
	else:
		c += 20
print(c)


d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
re = 0
for i in range(int(input())):
	re += d[input().strip()]
print(re)


n = int(input())
i = 1
x = []
p = 0
while i <= n:
	x.append(input())
	i = i + 1
i = 0
while i <= n - 1:
	if x[i] == 'Tetrahedron':
		p = p + 4
	elif x[i] == 'Cube':
		p = p + 6
	elif x[i] == 'Octahedron':
		p = p + 8
	elif x[i] == 'Dodecahedron':
		p = p + 12
	else:
		p = p + 20
	i = i + 1
print(p)


a = int(input())
dico = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
s = 0
for i in range(a):
	x = input()
	s += dico[x[0]]
print(s)


from collections import Counter
n = int(input())
lists = []
for _ in range(n):
	lists.append(input().rstrip())
b = Counter(lists)
print(b['Tetrahedron'] * 4 + b['Cube'] * 6 + b['Octahedron'] * 8 + b['Dodecahedron'] * 12 + b['Icosahedron'] * 20)


polygon_map = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
total = 0
for i in range(n):
	text = input()
	total += polygon_map[text]
print(total)


n = int(input())
mp = {'Icosahedron': 20, 'Cube': 6, 'Tetrahedron': 4, 'Dodecahedron': 12, 'Octahedron': 8}
su = 0
while n:
	su = su + mp[input()]
	n = n - 1
print(su)


polyhedrons_sides = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
t = int(input())
ans = 0
for i in range(t):
	ans += polyhedrons_sides[input()]
print(ans)


from sys import stdin, stdout
totalSides = 0
n = int(stdin.readline())
for _ in range(n):
	line = stdin.readline().rstrip()
	if line == 'Tetrahedron':
		totalSides += 4
	elif line == 'Cube':
		totalSides += 6
	elif line == 'Octahedron':
		totalSides += 8
	elif line == 'Dodecahedron':
		totalSides += 12
	elif line == 'Icosahedron':
		totalSides += 20
print(totalSides)


n = int(input())
poly = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
cnt = 0
for i in range(n):
	p = input().lstrip().rstrip()
	cnt += poly[p]
print(cnt)


def summa_graney(lst):
	s = 0
	for elem in lst:
		if elem == 'Tetrahedron':
			s += 4
		elif elem == 'Cube':
			s += 6
		elif elem == 'Octahedron':
			s += 8
		elif elem == 'Dodecahedron':
			s += 12
		elif elem == 'Icosahedron':
			s += 20
	return s
n = int(input())
a = list()
for i in range(n):
	s = input()
	a.append(s)
print(summa_graney(a))


n = int(input())
count = 0
for _ in range(n):
	a = input()
	if a[0] == 'T':
		count += 4
	elif a[0] == 'D':
		count += 12
	elif a[0] == 'I':
		count += 20
	elif a[0] == 'C':
		count += 6
	else:
		count += 8
print(count)


n = int(input())
ans = 0
for t in range(n):
	poly = input()
	if poly[0] == 'T':
		ans += 4
	elif poly[0] == 'C':
		ans += 6
	elif poly[0] == 'O':
		ans += 8
	elif poly[0] == 'D':
		ans += 12
	else:
		ans += 20
print(ans)


a = input()
i = int(a)
count = 0
j = 0
lst = ['Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron']
lst1 = [4, 6, 8, 12, 20]
n = 0
while n < i:
	a = input()
	j = 0
	for k in lst:
		if k == a:
			count = count + int(lst1[j])
		j = j + 1
	n = n + 1
print(count)


number = int(input())
faces = 0
for _ in range(number):
	types = input()
	if types == 'Tetrahedron':
		faces += 4
	elif types == 'Cube':
		faces += 6
	elif types == 'Octahedron':
		faces += 8
	elif types == 'Dodecahedron':
		faces += 12
	elif types == 'Icosahedron':
		faces += 20
	else:
		pass
print(faces)


ico = 20
cube = 6
octo = 8
dode = 12
tetra = 4
total = 0
for i in range(int(input())):
	quoi = input()
	if quoi == 'Tetrahedron':
		total += tetra
	elif quoi == 'Cube':
		total += cube
	elif quoi == 'Octahedron':
		total += octo
	elif quoi == 'Dodecahedron':
		total += dode
	else:
		total += ico
print(total)


n = int(input(''))
lib = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
res = 0
i = 0
while i < n:
	x = input('')
	res = res + lib[x]
	i += 1
print(res)


l = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
ans = 0
for i in range(n):
	s = str(input())
	ans += l[s]
print(ans)


num = input()
num = int(num)
shapeValues = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
answer = 0
for x in range(num):
	shape = input()
	answer += shapeValues[shape]
print(answer)


rp = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
c = 0
n = int(input())
for i in range(n):
	s = input()
	if s in rp:
		c = c + rp[s]
print(c)


sides = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
side = 0
for _ in range(n):
	sss = input()
	side += sides[sss]
print(side)


n = int(input())
poly = []
count = 0
for i in range(n):
	k = input()
	poly.append(k)
for j in range(len(poly)):
	if poly[j] == 'Tetrahedron':
		count = count + 4
	elif poly[j] == 'Cube':
		count = count + 6
	elif poly[j] == 'Octahedron':
		count = count + 8
	elif poly[j] == 'Dodecahedron':
		count = count + 12
	elif poly[j] == 'Icosahedron':
		count = count + 20
print(count)


dic = {'tetrahedron': 4, 'cube': 6, 'octahedron': 8, 'dodecahedron': 12, 'icosahedron': 20}
(fig_list, result) = ([], [])
num = int(input(''))

def counter(list, dict):
	for i in list:
		if i in dict.keys():
			re = dict[i]
			result.append(re)
	print(sum(result))
for i in range(num):
	f = input('')
	fig_list.append(f.lower())
counter(fig_list, dic)


n = int(input())
total = 0
for _ in range(n):
	name = input()
	if name == 'Tetrahedron':
		total += 4
	elif name == 'Cube':
		total += 6
	elif name == 'Octahedron':
		total += 8
	elif name == 'Dodecahedron':
		total += 12
	elif name == 'Icosahedron':
		total += 20
	else:
		total += 0
print(total)


n = int(input())
f = 0
for i in range(n):
	p = input()
	if p == 'Tetrahedron':
		f += 4
	elif p == 'Cube':
		f += 6
	elif p == 'Octahedron':
		f += 8
	elif p == 'Dodecahedron':
		f += 12
	else:
		f += 20
print(f)


count = int(input())
final = 0
while count != 0:
	string = input()
	if string == 'Tetrahedron':
		final += 4
	elif string == 'Cube':
		final += 6
	elif string == 'Octahedron':
		final += 8
	elif string == 'Dodecahedron':
		final += 12
	elif string == 'Icosahedron':
		final += 20
	count -= 1
print(final)


c = 0
n = int(input())
list1 = []
for i in range(n):
	list1.append(str(input()))
for alp in list1:
	if alp == 'Cube':
		c += 6
	elif alp == 'Octahedron':
		c += 8
	elif alp == 'Tetrahedron':
		c += 4
	elif alp == 'Icosahedron':
		c += 20
	elif alp == 'Dodecahedron':
		c += 12
print(c)


import sys
b = []
for line in sys.stdin.readlines():
	b.append(line.strip())
v = 0
for i in range(1, int(b[0]) + 1):
	if b[i] == 'Icosahedron':
		v += 20
	elif b[i] == 'Cube':
		v += 6
	elif b[i] == 'Tetrahedron':
		v += 4
	elif b[i] == 'Dodecahedron':
		v += 12
	elif b[i] == 'Octahedron':
		v += 8
print(v)


n = int(input())
faces = 0
for i in range(n):
	arr = input()
	if arr == 'Icosahedron':
		faces += 20
	elif arr == 'Cube':
		faces += 6
	elif arr == 'Octahedron':
		faces += 8
	elif arr == 'Dodecahedron':
		faces += 12
	else:
		faces += 4
print(faces)


n = int(input())
t = []
wyn = 0
for x in range(n):
	t += [input()]
	if t[x] == 'Tetrahedron':
		wyn += 4
	elif t[x] == 'Cube':
		wyn += 6
	elif t[x] == 'Octahedron':
		wyn += 8
	elif t[x] == 'Dodecahedron':
		wyn += 12
	else:
		wyn += 20
print(wyn)


def main():
	n = int(input())
	count = 0
	for i in range(n):
		polyhedron = input()
		if polyhedron == 'Icosahedron':
			count += 20
		elif polyhedron == 'Dodecahedron':
			count += 12
		elif polyhedron == 'Octahedron':
			count += 8
		elif polyhedron == 'Cube':
			count += 6
		else:
			count += 4
	print(count)
main()


x = int(input())
add = 0
for i in range(0, x):
	b = input()
	if b == 'Tetrahedron':
		b = 4
	elif b == 'Cube':
		b = 6
	elif b == 'Octahedron':
		b = 8
	elif b == 'Dodecahedron':
		b = 12
	elif b == 'Icosahedron':
		b = 20
	add = add + b
print(add)


def main():
	poly = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	n = int(input())
	polyhedrons = []
	for i in range(n):
		polyhedrons.append(input())
	ans = 0
	for i in polyhedrons:
		ans += poly[i]
	print(ans)
main()


Polyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
NumberOfPolyhedrons = int(input())
NumberOfSides = 0
for i in range(NumberOfPolyhedrons):
	Polyhedron = input()
	NumberOfSides += Polyhedrons[Polyhedron]
print(NumberOfSides)


from builtins import print
face = {'Icosahedron': 20, 'Dodecahedron': 12, 'Octahedron': 8, 'Cube': 6, 'Tetrahedron': 4}
faces = 0
for i in range(int(input())):
	faces += face[input()]
print(faces)


n = int(input())
polihedra = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
edra = []
sum = 0
for i in range(n + 1):
	edra.append(input())
	if i == n - 1:
		break
for (onoma, edres) in polihedra.items():
	for i in edra:
		if i == onoma:
			sum = sum + edres
print(sum)


n = int(input())
x = 0
for i in range(n):
	a = str(input())
	if a[0] == 'T':
		x += 4
	elif a[0] == 'C':
		x += 6
	elif a[0] == 'O':
		x += 8
	elif a[0] == 'D':
		x += 12
	elif a[0] == 'I':
		x += 20
print(x)


n = int(input())
arr = []
count = int()
for x in range(n):
	arr.append(input())
	if arr[x] == 'Tetrahedron':
		count += 4
	elif arr[x] == 'Cube':
		count += 6
	elif arr[x] == 'Octahedron':
		count += 8
	elif arr[x] == 'Dodecahedron':
		count += 12
	elif arr[x] == 'Icosahedron':
		count += 20
print(count)


n = int(input())
rp = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
sum = 0
for l in range(n):
	sum += rp[input()[0]]
print(sum)


import sys
from random import choice, randint
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def MI():
	return map(int, sys.stdin.readline().strip().split())

def LI():
	return list(map(int, sys.stdin.readline().strip().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines().strip()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().strip().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().strip().split()]

def LS():
	return sys.stdin.readline().strip().split()

def I():
	return int(sys.stdin.readline().strip())

def F():
	return float(sys.stdin.readline().strip())

def S():
	return sys.stdin.readline().strip()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def JA(a, sep):
	return sep.join(map(str, a))

def JAA(a, s, t):
	return s.join((t.join(map(str, b)) for b in a))
inp = sys.stdin.readline
out = sys.stdout.write

def main():
	n = I()
	c = 0
	for i in range(n):
		x = S()
		if x == 'Icosahedron':
			c += 20
		if x == 'Cube':
			c += 6
		if x == 'Tetrahedron':
			c += 4
		if x == 'Dodecahedron':
			c += 12
		if x == 'Octahedron':
			c += 8
	pf(c)
main()


face_dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
t = int(input())
total = 0
for i in range(t):
	total += face_dict[input().strip()]
print(total)


polyhedronsDict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
polyhedrons = []
n = int(input())
for i in range(n):
	polyhedrons.append(input())
total = 0
for polyhedron in polyhedrons:
	total += polyhedronsDict[polyhedron]
print(total)


import sys
counter = 0
answer = 0
answer_dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for lin in sys.stdin:
	line = lin.rstrip()
	if counter == 0:
		a = int(line)
	elif counter <= a:
		answer += answer_dict[line]
	if counter > a:
		break
	counter += 1
print(answer)


def main():
	li = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
	ans = 0
	n = int(input())
	while n > 0:
		shape = input()[0]
		ans += li[shape]
		n -= 1
	print(ans)
main()


s = int(input())
q = []
j = 0
for i in range(s):
	q.append(input())
for i in q:
	if i == 'Icosahedron':
		j += 20
	elif i == 'Dodecahedron':
		j += 12
	elif i == 'Octahedron':
		j += 8
	elif i == 'Cube':
		j += 6
	else:
		j += 4
print(j)


n = int(input())
dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
sumVal = 0
for i in range(n):
	s = input()
	sumVal += dict[s]
print('{}\n'.format(sumVal))


t = int(input())
list1 = []
for x in range(t):
	name = input()
	list1.append(name)
sum = 0
for x in list1:
	if x == 'Tetrahedron':
		sum += 4
	elif x == 'Cube':
		sum += 6
	elif x == 'Octahedron':
		sum += 8
	elif x == 'Dodecahedron':
		sum += 12
	else:
		sum += 20
print(sum)


hmap = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
num = int(input())
res = 0
for i in range(num):
	res += hmap[input()]
print(res)


def prog(n):
	ans = 0
	for i in range(n):
		i = i
		s = input()
		if s == 'Tetrahedron':
			ans += 4
		elif s == 'Cube':
			ans += 6
		elif s == 'Octahedron':
			ans += 8
		elif s == 'Dodecahedron':
			ans += 12
		elif s == 'Icosahedron':
			ans += 20
	return ans
n = int(input())
print(prog(n))


n = int(input())
b = list()
for i in range(0, n):
	a = input()
	b.append(a)
count = 0
for i in range(0, len(b)):
	if b[i] == 'Tetrahedron':
		count = count + 4
	elif b[i] == 'Cube':
		count = count + 6
	elif b[i] == 'Octahedron':
		count = count + 8
	elif b[i] == 'Dodecahedron':
		count = count + 12
	elif b[i] == 'Icosahedron':
		count = count + 20
print(count)


from functools import reduce
polyhedrons = int(input())
shapes = [input() for i in range(polyhedrons)]
faces = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
print(reduce(lambda x, y: x + y, list(map(lambda x: faces[x], shapes))))


weights = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
poly = {}
n = int(input())
for i in range(n):
	shape = input()
	poly[shape] = poly.setdefault(shape, 0) + 1
print(sum([poly[i] * weights[i] for i in poly]))


import collections
n = int(input())
de = collections.deque([])
for i in range(n):
	de.append(input())
total = 4 * de.count('Tetrahedron') + 6 * de.count('Cube') + 8 * de.count('Octahedron') + 12 * de.count('Dodecahedron') + 20 * de.count('Icosahedron')
print(total)


import sys
n = int(sys.stdin.readline())
granes = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
ans = 0
for i in range(n):
	t = sys.stdin.readline().strip()
	ans += granes[t]
print(ans)


s = int(input())
d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
c = 0
while s != 0:
	shape = input()
	c = c + d[shape]
	s = s - 1
print(c)


x = int(input())
z = 0
for _ in range(x):
	a = str(input())
	if a == 'Tetrahedron':
		z += 4
	elif a == 'Cube':
		z += 6
	elif a == 'Octahedron':
		z += 8
	elif a == 'Dodecahedron':
		z += 12
	elif a == 'Icosahedron':
		z += 20
print(z)


n = int(input())
t = {'C': 6, 'T': 4, 'O': 8, 'D': 12, 'I': 20}
result = 0
for i in range(n):
	x = input()
	result += t[x[0]]
print(result)


a = int(input())
result = 0
for index in range(a):
	name = input()
	if name == 'Tetrahedron':
		result += 4
	elif name == 'Cube':
		result += 6
	elif name == 'Octahedron':
		result += 8
	elif name == 'Dodecahedron':
		result += 12
	elif name == 'Icosahedron':
		result += 20
print(result)


n = int(input())
face = 0
for s in range(n):
	shape = input()
	if shape[0] == 'I':
		face += 20
	elif shape[0] == 'D':
		face += 12
	elif shape[0] == 'O':
		face += 8
	elif shape[0] == 'C':
		face += 6
	else:
		face += 4
print(face)


def polyhedron(s):
	if s == 'Tetrahedron':
		return 4
	elif s == 'Cube':
		return 6
	elif s == 'Octahedron':
		return 8
	elif s == 'Dodecahedron':
		return 12
	else:
		return 20
n = int(input())
result = 0
for i in range(n):
	s = str(input())
	result = result + polyhedron(s)
print(result)


x = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
a = int(input())
sum = 0
while a > 0:
	b = input()
	z = x.get(b)
	sum = sum + z
	a = a - 1
print(sum)


n = int(input())
total_caras = 0

def num_caras(poliedro):
	if poliedro == 'Tetrahedron':
		return 4
	elif poliedro == 'Cube':
		return 6
	elif poliedro == 'Octahedron':
		return 8
	elif poliedro == 'Dodecahedron':
		return 12
	elif poliedro == 'Icosahedron':
		return 20
for i in range(n):
	poliedro = input()
	total_caras += num_caras(poliedro)
print(total_caras)


def solve(a):
	if a == 'Tetrahedron':
		return 4
	elif a == 'Cube':
		return 6
	elif a == 'Octahedron':
		return 8
	elif a == 'Dodecahedron':
		return 12
	elif a == 'Icosahedron':
		return 20
queries_count = int(input())
sum = 0
while queries_count > 0:
	sum += solve(input())
	queries_count -= 1
print(sum)


n = int(input())
dictof = {}
for i in range(n):
	x = input()
	if x not in dictof:
		dictof[x] = 0
		dictof[x] += 1
	else:
		dictof[x] += 1
t = dictof.get('Tetrahedron', 0)
o = dictof.get('Octahedron', 0)
d = dictof.get('Dodecahedron', 0)
c = dictof.get('Cube', 0)
i = dictof.get('Icosahedron', 0)
print(t * 4 + o * 8 + d * 12 + c * 6 + i * 20)


polyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
userInt = []
n = int(input())
total = 0
for x in range(n):
	userInt.append(input())
for x in range(n):
	total += polyhedrons[userInt[x]]
print(total)


x = int(input())
s = 0
for __ in range(x):
	n = input()
	if n == 'Tetrahedron':
		s += 4
	elif n == 'Cube':
		s += 6
	elif n == 'Octahedron':
		s += 8
	elif n == 'Dodecahedron':
		s += 12
	else:
		s += 20
print(s)


res = 0
d = {'Tetrahedron': 4, 'Cube': 6, 'Dodecahedron': 12, 'Icosahedron': 20, 'Octahedron': 8}
for i in range(int(input())):
	s = str(input())
	if s in d:
		res += d[s]
print(res)


t = int(input())
cont = 0
for c in range(t):
	a = str(input())
	if a == 'Icosahedron':
		cont += 20
	elif a == 'Cube':
		cont += 6
	elif a == 'Tetrahedron':
		cont += 4
	elif a == 'Dodecahedron':
		cont += 12
	elif a == 'Octahedron':
		cont += 8
print(cont)


n = int(input())
face = 0
for i in range(n):
	s = str(input())
	if s[0] == 'T':
		face += 4
	if s[0] == 'C':
		face += 6
	if s[0] == 'O':
		face += 8
	if s[0] == 'D':
		face += 12
	if s[0] == 'I':
		face += 20
print(face)


t = {'tetrahedron': 4, 'cube': 6, 'octahedron': 8, 'dodecahedron': 12, 'icosahedron': 20}
result = 0
for i in range(int(input())):
	s = input().lower()
	result += t[s]
print(result)


shps = int(input())
sda = 0
for i in range(shps):
	sp = input()
	if sp == 'Tetrahedron':
		sda += 4
	elif sp == 'Cube':
		sda += 6
	elif sp == 'Octahedron':
		sda += 8
	elif sp == 'Dodecahedron':
		sda += 12
	elif sp == 'Icosahedron':
		sda += 20
print(sda)


n = int(input())
values = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
figures = [input() for i in range(n)]
answer = sum([values[figure] for figure in figures])
print(answer)


__author__ = 'artyom'

def main():
	mp = {'Icosahedron': 20, 'Cube': 6, 'Tetrahedron': 4, 'Dodecahedron': 12, 'Octahedron': 8}
	s = 0
	for i in range(read()):
		s += mp[read(0)]
	return s

def read(mode=1, size=None):
	if mode == 0:
		return input().strip()
	if mode == 1:
		return int(input().strip())
	if mode == 2:
		return input().strip().split()
	if mode == 3:
		return list(map(int, input().strip().split()))
	a = []
	for _ in range(size):
		a.append(read(3))
	return a

def write(s='\n'):
	if s is None:
		s = ''
	if isinstance(s, tuple) or isinstance(s, list):
		s = ' '.join(map(str, s))
	s = str(s)
	print(s, end='\n')
write(main())


n = int(input())
A = []
s = 0
for i in range(n):
	A.append(input())
for items in range(n):
	if A[items] == 'Tetrahedron':
		s += 4
	elif A[items] == 'Cube':
		s += 6
	elif A[items] == 'Octahedron':
		s += 8
	elif A[items] == 'Dodecahedron':
		s += 12
	elif A[items] == 'Icosahedron':
		s += 20
print(s)


import sys
shapes = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
collection = []
for i in range(n):
	collection.append(input())
ans = 0
for item in collection:
	ans += shapes[item]
print(ans)
sys.exit()


n = input()
poly = []
Sum = 0
for i in range(0, int(n)):
	p = input()
	if p == 'Tetrahedron':
		Sum += 4
	elif p == 'Cube':
		Sum += 6
	elif p == 'Octahedron':
		Sum += 8
	elif p == 'Dodecahedron':
		Sum += 12
	elif p == 'Icosahedron':
		Sum += 20
print(Sum)


n = int(input())
count = 0
(s1, s2, s3, s4, s5) = ('Tetrahedron', 'Cube', 'Octahedron', 'Dodecahedron', 'Icosahedron')
for i in range(n):
	s = str(input())
	if s == s1:
		count += 4
	elif s == s2:
		count += 6
	elif s == s3:
		count += 8
	elif s == s4:
		count += 12
	elif s == s5:
		count += 20
print(count)


test = int(input())
hashy = {'Icosahedron': 20, 'Cube': 6, 'Octahedron': 8, 'Tetrahedron': 4, 'Dodecahedron': 12}
faces = 0
for i in range(test):
	faces += hashy[input()]
print(faces)


polyhedrons = int(input())
names = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
faces = 0
for x in range(polyhedrons):
	name = input()
	faces += names[name]
print(faces)


faces_dict = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
count = int(input())
faces = 0
for _ in range(count):
	faces += faces_dict[input()]
print(faces)


n = int(input())
l = []
for i in range(n):
	j = input()
	l += [j]
o = {'4': 'Tetrahedron', '6': 'Cube', '8': 'Octahedron', '12': 'Dodecahedron', '20': 'Icosahedron'}
c = 0
for (i, e) in o.items():
	if e in l:
		c += int(i) * l.count(e)
print(c)


x = int(input())
sum = int()
for i in range(x):
	c = str(input())
	if c == 'Tetrahedron':
		sum += 4
	elif c == 'Cube':
		sum += 6
	elif c == 'Octahedron':
		sum += 8
	elif c == 'Dodecahedron':
		sum += 12
	elif c == 'Icosahedron':
		sum += 20
print(sum)


n = int(input())
a = [str(input()) for x in range(n)]
dict = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
z = 0
for x in a:
	z += dict[x[0]]
print(z)


polyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
output = 0
for i in range(int(input())):
	output += polyhedrons[input()]
print(output)


n = int(input())
walls = 0
for x in range(n):
	figure = input()
	if figure == 'Tetrahedron':
		walls += 4
	elif figure == 'Cube':
		walls += 6
	elif figure == 'Octahedron':
		walls += 8
	elif figure == 'Dodecahedron':
		walls += 12
	elif figure == 'Icosahedron':
		walls += 20
print(walls)


face_dic = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
count_dic = {'Tetrahedron': 0, 'Cube': 0, 'Octahedron': 0, 'Dodecahedron': 0, 'Icosahedron': 0}
faces = 0
n = int(input())
for _ in range(n):
	new = input()
	count_dic[new] += 1
for key in count_dic:
	faces += count_dic[key] * face_dic[key]
print(faces)


def polyherdrons(keyword):
	d = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
	return d[keyword]
n = int(input())
s = 0
l = list((input() for _ in range(n)))
for i in l:
	s += polyherdrons(i)
print(s)


number_of_polyhedrons = int(input())
count = 0
for i in range(number_of_polyhedrons):
	geometric_figure = input()
	if geometric_figure == 'Tetrahedron':
		count += 4
	elif geometric_figure == 'Cube':
		count += 6
	elif geometric_figure == 'Octahedron':
		count += 8
	elif geometric_figure == 'Dodecahedron':
		count += 12
	elif geometric_figure == 'Icosahedron':
		count += 20
print(count)


def poly(lst):
	tot = 0
	for i in lst:
		if i == 'Tetrahedron':
			tot += 4
		if i == 'Cube':
			tot += 6
		if i == 'Octahedron':
			tot += 8
		if i == 'Dodecahedron':
			tot += 12
		if i == 'Icosahedron':
			tot += 20
	return tot
t = int(input())
lst = []
while t > 0:
	lst.append(input())
	t -= 1
print(poly(lst))


no_of_times = int(input())
x = 0
answer = 0
for n in range(no_of_times):
	z = input()
	if z == 'Tetrahedron':
		answer += 4
	elif z == 'Cube':
		answer += 6
	elif z == 'Octahedron':
		answer += 8
	elif z == 'Dodecahedron':
		answer += 12
	else:
		answer += 20
print(answer)


n = int(input())
count = 0
for i in range(n):
	p = input()
	if p == 'Tetrahedron':
		count = count + 4
	elif p == 'Cube':
		count = count + 6
	elif p == 'Octahedron':
		count = count + 8
	elif p == 'Dodecahedron':
		count = count + 12
	elif p == 'Icosahedron':
		count = count + 20
	else:
		pass
print(count)


import math
import os
import random
import re
import sys
n = int(input())
c = 0
for x in range(n):
	y = input()
	if y == 'Tetrahedron':
		c = c + 4
	elif y == 'Cube':
		c = c + 6
	elif y == 'Octahedron':
		c = c + 8
	elif y == 'Dodecahedron':
		c = c + 12
	elif y == 'Icosahedron':
		c = c + 20
print(c)


d = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
print(sum((d[input()[:1]] for _ in range(int(input())))))


def input_func():
	while True:
		num = int(input())
		if 1 <= num <= 200000:
			list_polyhedrons = []
			for i in range(num):
				list_polyhedrons.append(input())
			break
		else:
			continue
	return (num, list_polyhedrons)

def calculate_faces(num, list_polyhedrons):
	faces = 0
	for i in list_polyhedrons:
		if i == 'Tetrahedron':
			faces += 4
		elif i == 'Cube':
			faces += 6
		elif i == 'Octahedron':
			faces += 8
		elif i == 'Dodecahedron':
			faces += 12
		elif i == 'Icosahedron':
			faces += 20
	return faces

def print_result(faces):
	print(faces)
(num, list_polyhedrons) = input_func()
faces = calculate_faces(num, list_polyhedrons)
print_result(faces)


n = int(input())
pol = [input() for i in range(n)]
ret = 0
for i in range(n):
	if pol[i][0] == 'T':
		ret += 4
	elif pol[i][0] == 'C':
		ret += 6
	elif pol[i][0] == 'O':
		ret += 8
	elif pol[i][0] == 'D':
		ret += 12
	else:
		ret += 20
print(ret)


a = ['Tetrahedron', 4, 'Cube', 6, 'Octahedron', 8, 'Dodecahedron', 12, 'Icosahedron', 20]
b = int(input())
x = 0
for i in range(b):
	x += a[a.index(input()) + 1]
print(x)


x = int(input())
figures = []
for i in range(x):
	figures.append(input())
total_sum = 0
all_values = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
for i in figures:
	total_sum += all_values[i]
print(total_sum)


isDebug = False
m = {}
m['Tetrahedron'] = 4
m['Cube'] = 6
m['Octahedron'] = 8
m['Dodecahedron'] = 12
m['Icosahedron'] = 20
n = int(input())
t = 0
for i in range(0, n):
	s = input()
	t = t + m[s]
print(f'{t}')


def polyheads(arr):
	di = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
	suma = 0
	for i in arr:
		suma += di[i[0]]
	return suma
n = int(input())
s = []
for i in range(n):
	x = input()
	s.append(x)
print(polyheads(s))


x = int(input())
y = dict([('Tetrahedron', 4), ('Cube', 6), ('Octahedron', 8), ('Dodecahedron', 12), ('Icosahedron', 20)])
res = 0
while x:
	x -= 1
	res += y[str(input())]
print(res)


poly = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
sum = 0
for tt in range(int(input())):
	tpe = input().strip()
	sum += poly[tpe]
print(sum)


c = int(input())
j = 1
p = 0
while j <= c:
	a = input()
	if a[0] == 'T':
		p += 4
	elif a[0] == 'C':
		p += 6
	elif a[0] == 'O':
		p += 8
	elif a[0] == 'D':
		p += 12
	else:
		p += 20
	j += 1
print(p)


n = int(input())
counter = 0
c = 0
polyhedron_list = []

def count_hedron(text, counter):
	if text == 'Tetrahedron':
		counter += 4
	elif text == 'Cube':
		counter += 6
	elif text == 'Octahedron':
		counter += 8
	elif text == 'Dodecahedron':
		counter += 12
	elif text == 'Icosahedron':
		counter += 20
	else:
		print('hello')
	return counter
for i in range(n):
	text = input()
	c += count_hedron(text, counter)
print(c)


mp = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
sum = 0
for i in range(n):
	txt = input()
	sum += mp[txt]
print(sum)


faces = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
total = 0
for nr in range(n):
	act = input()
	total += faces[act]
print(total)


x = int(input())
m = 0
a = 1
for a in range(x):
	y = input()
	if y == 'Tetrahedron':
		m = m + 4
	elif y == 'Cube':
		m = m + 6
	elif y == 'Octahedron':
		m = m + 8
	elif y == 'Dodecahedron':
		m = m + 12
	elif y == 'Icosahedron':
		m = m + 20
print(m)


n = int(input())
vb = 0
for fff in range(0, n):
	sd = input()
	if sd == 'Icosahedron':
		vb = vb + 20
	if sd == 'Tetrahedron':
		vb = vb + 4
	if sd == 'Cube':
		vb = vb + 6
	if sd == 'Octahedron':
		vb = vb + 8
	if sd == 'Dodecahedron':
		vb = vb + 12
print(vb)


dic = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(input())
arr = [input() for i in range(n)]
sum = 0
for figure in arr:
	sum += dic[figure]
print(sum)


n_n = 0
l = [['Tetrahedron', 4], ['Icosahedron', 20], ['Cube', 6], ['Dodecahedron', 12], ['Octahedron', 8]]
n = int(input())
for i in range(n):
	m = input()
	n_l = [x for x in l if m in x][0]
	n_n += n_l[1]
print(n_n)


number = int(input())
count = 0
result = 0
while count < number:
	data = input()
	count += 1
	if data == 'Tetrahedron':
		result += 4
	elif data == 'Cube':
		result += 6
	elif data == 'Octahedron':
		result += 8
	elif data == 'Dodecahedron':
		result += 12
	elif data == 'Icosahedron':
		result += 20
print(result)


inp = lambda : (int, input().split())
n = int(input())
sum = 0
for i in range(n):
	s = input()
	if s == 'Tetrahedron':
		sum += 4
	elif s == 'Cube':
		sum += 6
	elif s == 'Octahedron':
		sum += 8
	elif s == 'Dodecahedron':
		sum += 12
	else:
		sum += 20
print(sum)


num = int(input())
l = []
for i in range(0, num):
	l.append(input())
count = 0
for i in range(0, num):
	if l[i] == 'Tetrahedron':
		count += 4
	elif l[i] == 'Cube':
		count += 6
	elif l[i] == 'Octahedron':
		count += 8
	elif l[i] == 'Dodecahedron':
		count += 12
	elif l[i] == 'Icosahedron':
		count += 20
print(count)


n = int(input())
polyhedrons = {'T': 4, 'C': 6, 'O': 8, 'D': 12, 'I': 20}
output = 0
for i in range(n):
	word = input()
	letter = word[0]
	output += polyhedrons[letter]
print(output)


x = int(input())
poly = []
for i in range(x):
	y = input()
	poly.append(y)
sum = 0
for i in poly:
	if i == 'Tetrahedron':
		sum += 4
	elif i == 'Cube':
		sum += 6
	elif i == 'Octahedron':
		sum += 8
	elif i == 'Dodecahedron':
		sum += 12
	elif i == 'Icosahedron':
		sum += 20
print(sum)


TetraCount = 0
CubeCount = 0
OctaCount = 0
DodeCount = 0
IcosaCount = 0
N = int(input())
for i in range(N):
	K = input()
	if K == 'Tetrahedron':
		TetraCount += 1
	elif K == 'Cube':
		CubeCount += 1
	elif K == 'Octahedron':
		OctaCount += 1
	elif K == 'Dodecahedron':
		DodeCount += 1
	else:
		IcosaCount += 1
print(TetraCount * 4 + CubeCount * 6 + OctaCount * 8 + DodeCount * 12 + IcosaCount * 20)


polygons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}

def calculate_total_faces():
	n = int(input())
	total_faces = 0
	while n > 0:
		polygon = input()
		total_faces += polygons[polygon]
		n -= 1
	print(total_faces)
calculate_total_faces()


import sys
polyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
n = int(sys.stdin.readline().strip())
res = 0
for i in range(n):
	line = sys.stdin.readline().strip()
	res += polyhedrons[line]
print(res)


k = 0
f = ['', '', '', '', 'T', '', 'C', '', 'O', '', '', '', 'D', '', '', '', '', '', '', '', 'I']
for i in range(int(input())):
	s = str(input())
	k += f.index(s[0])
print(k)


N = int(input())
polyhedrons = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
sum = 0
for i in range(N):
	x = input()
	sum += polyhedrons[x]
print(sum)


a = int(input())
b = []
k = 0
for i in range(0, a):
	b.append(input())
a1 = b.count('Tetrahedron')
a2 = b.count('Cube')
a3 = b.count('Octahedron')
a4 = b.count('Dodecahedron')
a5 = b.count('Icosahedron')
p = a1 * 4 + a2 * 6 + a3 * 8 + a4 * 12 + a5 * 20
print(p)


from sys import stdin, stdout
n = stdin.readline()
shapes = {'Tetrahedron': 4, 'Cube': 6, 'Octahedron': 8, 'Dodecahedron': 12, 'Icosahedron': 20}
inp = [x.rstrip() for x in stdin.readlines()]
inp = [int(shapes[x]) for x in inp]
stdout.write(str(sum(inp)) + '\n')


def main():
	sum_faces = 0
	n = int(input())
	for i in range(n):
		faces = detect(str(input()))
		sum_faces += faces
	print(sum_faces)

def detect(string):
	if string == 'Tetrahedron':
		return 4
	elif string == 'Cube':
		return 6
	elif string == 'Octahedron':
		return 8
	elif string == 'Dodecahedron':
		return 12
	elif string == 'Icosahedron':
		return 20
main()


facecount = 0
Num = int(input())
for i in range(Num):
	shape = input()
	if shape == 'Tetrahedron':
		facecount += 4
	elif shape == 'Cube':
		facecount += 6
	elif shape == 'Octahedron':
		facecount += 8
	elif shape == 'Dodecahedron':
		facecount += 12
	elif shape == 'Icosahedron':
		facecount += 20
	else:
		print('error')
print(facecount)