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