#include <bits/stdc++.h>
using namespace std;
int main() {
  string t = "Tetrahedron";
  string c = "Cube";
  string o = "Octahedron";
  string d = "Dodecahedron";
  string i = "Icosahedron";
  int n;
  cin >> n;
  string temp = "";
  int sum = 0;
  for (int j = 0; j < n; ++j) {
    cin >> temp;
    if (temp == t) sum += 4;
    if (temp == c) sum += 6;
    if (temp == o) sum += 8;
    if (temp == d) sum += 12;
    if (temp == i) sum += 20;
  }
  cout << sum << endl;
}
