#include <bits/stdc++.h>
using namespace std;
int main() {
  map<string, int> m;
  m["Tetrahedron"] = 4;
  m["Cube"] = 6;
  m["Octahedron"] = 8;
  m["Dodecahedron"] = 12;
  m["Icosahedron"] = 20;
  map<string, int>::iterator it;
  string s;
  int n, i, sum = 0;
  cin >> n;
  while (n--) {
    cin >> s;
    it = m.find(s);
    sum += it->second;
  }
  cout << sum;
  return 0;
}
