#include <bits/stdc++.h>
using namespace std;
vector<int> readIS(int n) {
  vector<int> ints;
  int b;
  for (int i = 0; i < n; i++) {
    cin >> b;
    ints.push_back(b);
  }
  return ints;
}
void toLower(string &q) {
  for (int i = 0; i < (q).size(); i++) q[i] = tolower(q[i]);
}
void toUpper(string &q) {
  for (int i = 0; i < (q).size(); i++) q[i] = toupper(q[i]);
}
int sum(vector<int> string) {
  int r = 0;
  for (int i = 0; i < (string).size(); i++) r += string[i];
  return r;
}
int main() {
  int n;
  cin >> n;
  ;
  string q;
  int r = 0;
  for (int i = 0; i < n; i++) {
    cin >> q;
    if (q == "Tetrahedron")
      r += 4;
    else if (q == "Cube")
      r += 6;
    else if (q == "Octahedron")
      r += 8;
    else if (q == "Dodecahedron")
      r += 12;
    else if (q == "Icosahedron")
      r += 20;
  }
  cout << r;
}
