#CF785A. Anton and Polyhedrons

Anton and Polyhedrons

题目描述

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

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

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

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

输入格式

The first line of the input contains a single integer n n (1<=n<=200000) (1<=n<=200000) — the number of polyhedrons in Anton's collection.

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

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

输出格式

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

题目大意

题目描述

Anton最喜欢的几何图形是正多面体。 有五种正多面体:

四面体:有4个4个三角形的面。

立方体:有6个6正方形的面。

八面体:有8个8个三角形的面。

十二面体:有12个12个五边形的面。

二十面体:有20个20个三角形的面。

形状如图:

编写程序,帮Anton求出他的n个多面体的总面数s。

输入输出格式

输入:

第一行为一个整数N(1<n<=200000)

第2~n+1行包含一个字符串s[i](Anton集合中的第i个多面体的名称)

输入方式如下(不带引号):

“Tetrahedron”表示四面体; “Cube”表示立方体; “Octahedron”表示八面体; “Dodecahedron”表示十二面体; “Icosahedron”表示二十面体。

输出格式:

输出一个整数s。

说明:

在第一个样例输入中,Anton有一个二十面体、一个立方体、一个四面体和一个十二面体。二十面体有20个面,立方体有6个面,四面体有4个面,十二面体有12个面。所以,它们一共有20 + 6 + 4 + 12=42个面。

(好水的题目)

4
Icosahedron
Cube
Tetrahedron
Dodecahedron

42

3
Dodecahedron
Octahedron
Octahedron

28

提示

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