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