#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
map<string, int> M;
int main() {
  int N;
  M["Tetrahedron"] = 4;
  M["Cube"] = 6;
  M["Octahedron"] = 8;
  M["Dodecahedron"] = 12;
  M["Icosahedron"] = 20;
  while (cin >> N) {
    int Sum = 0;
    for (int i = 0; i < N; i++) {
      string Temp;
      cin >> Temp;
      Sum += M[Temp];
    }
    cout << Sum << endl;
  }
  return 0;
}
