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