#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, j, k, arr[100000], l, m, n, x, coun, sum, ans, T, check;
  char str[6][100] = {"Tetrahedron", "Cube", "Octahedron", "Dodecahedron",
                      "Icosahedron"};
  string s;
  string Te = str[0];
  string Cu = str[1];
  string Oc = str[2];
  string Do = str[3];
  string Ic = str[4];
  vector<long long> V;
  cin >> n;
  ans = 0;
  for (i = 0; i < n; i++) {
    cin >> s;
    if (s == Te)
      ans += 4;
    else if (s == Cu)
      ans += 6;
    else if (s == Oc)
      ans += 8;
    else if (s == Do)
      ans += 12;
    else if (s == Ic)
      ans += 20;
  }
  cout << ans << endl;
  return 0;
}
