#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;
  int n, s = 0;
  string x;
  cin >> n;
  while (n--) {
    cin >> x;
    s += M[x];
  }
  cout << s;
}
