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