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