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