#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  unordered_map<string, int> polyhedrons;
  polyhedrons.insert(make_pair("Tetrahedron", 4));
  polyhedrons.insert(make_pair("Cube", 6));
  polyhedrons.insert(make_pair("Octahedron", 8));
  polyhedrons.insert(make_pair("Dodecahedron", 12));
  polyhedrons.insert(make_pair("Icosahedron", 20));
  int n;
  cin >> n;
  int sum = 0;
  for (int i = 0; i < n; i++) {
    string p;
    cin >> p;
    sum += polyhedrons.at(p);
  }
  std::cout << sum << "\n";
  return 0;
}
