#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  unordered_map<string, long long> m;
  m["Tetrahedron"] = 4;
  m["Cube"] = 6;
  m["Octahedron"] = 8;
  m["Dodecahedron"] = 12;
  m["Icosahedron"] = 20;
  long long n;
  cin >> n;
  long long count = 0;
  while (n--) {
    string str;
    cin >> str;
    count += m[str];
  }
  cout << count << endl;
  return 0;
}
