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