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