#include <bits/stdc++.h>
using namespace std;
int N, total = 0;
string S;
int main() {
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> S;
    if (S == "Tetrahedron") total += 4;
    if (S == "Cube") total += 6;
    if (S == "Octahedron") total += 8;
    if (S == "Dodecahedron") total += 12;
    if (S == "Icosahedron") total += 20;
  }
  cout << total << endl;
}
