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