#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  string temp;
  while (cin >> n) {
    int sum = 0;
    while (n--) {
      cin >> temp;
      if (temp == "Tetrahedron")
        sum += 4;
      else if (temp == "Cube")
        sum += 6;
      else if (temp == "Octahedron")
        sum += 8;
      else if (temp == "Dodecahedron")
        sum += 12;
      else if (temp == "Icosahedron")
        sum += 20;
    }
    cout << sum << endl;
  }
}
