#include <bits/stdc++.h>
using namespace std;
int n, s;
vector<string> names;
string name_read;
int facesFromName(string name) {
  int value = 20;
  if (name == "Tetrahedron") value = 4;
  if (name == "Cube") value = 6;
  if (name == "Octahedron") value = 8;
  if (name == "Dodecahedron") value = 12;
  return value;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> name_read;
    names.push_back(name_read);
  }
  for (int i = 0; i < n; i++) s += facesFromName(names.at(i));
  cout << s;
  return 0;
}
