#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, p, ans(0);
  cin >> n;
  map<string, int> mp;
  string s;
  while (n--) {
    cin >> s;
    mp[s]++;
  }
  for (auto x : mp) {
    if (x.first == "Tetrahedron")
      p = 4;
    else if (x.first == "Cube")
      p = 6;
    else if (x.first == "Octahedron")
      p = 8;
    else if (x.first == "Dodecahedron")
      p = 12;
    else
      p = 20;
    ans += p * x.second;
  }
  cout << ans;
}
