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