#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e7;
int main(int argc, char const *argv[]) {
  int N;
  cin >> N;
  int64_t sum = 0LL;
  while (N--) {
    string a;
    cin >> a;
    if (a == "Tetrahedron") {
      sum += 4;
    } else if (a == "Cube") {
      sum += 6;
    } else if (a == "Octahedron") {
      sum += 8;
    } else if (a == "Dodecahedron") {
      sum += 12;
    } else if (a == "Icosahedron") {
      sum += 20;
    } else {
      do {
        std::cerr << "\"WHAT THE FUCK\""
                  << ": "
                  << "WHAT THE FUCK" << std::endl;
      } while (0);
    }
  }
  cout << sum << "\n";
  return 0;
}
