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