#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k = 0;
  cin >> n;
  string s;
  string a1 = "Tetrahedron", a2 = "Cube", a3 = "Octahedron",
         a4 = "Dodecahedron", a5 = "Icosahedron";
  for (int i = 0; i < n; i++) {
    cin >> s;
    if (s == a1) k += 4;
    if (s == a2) k += 6;
    if (s == a3) k += 8;
    if (s == a4) k += 12;
    if (s == a5) k += 20;
  }
  cout << k;
  return 0;
}
