#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, res = 0;
  cin >> n;
  string in;
  map<string, int> a = {{"Tetrahedron", 4},
                        {"Cube", 6},
                        {"Octahedron", 8},
                        {"Dodecahedron", 12},
                        {"Icosahedron", 20}};
  for (int i = 1; i <= n; i++) {
    cin >> in;
    res += a[in];
  }
  cout << res << endl;
  return 0;
}
