#include <bits/stdc++.h>
using namespace std;
int (*funcArr2[10])(float, char, char) = {NULL};
int main() {
  map<string, int> status;
  status["Tetrahedron"] = 4;
  status["Cube"] = 6;
  status["Octahedron"] = 8;
  status["Dodecahedron"] = 12;
  status["Icosahedron"] = 20;
  int n, ans = 0;
  string str;
  cin >> n;
  while (n--) {
    cin >> str;
    ans += status[str];
  }
  cout << ans << endl;
  return 0;
}
