#include <bits/stdc++.h>
const double PI = 3.141592653589793238460;
using namespace std;
void anton() {
  int n;
  cin >> n;
  int ans = 0;
  while (n--) {
    string s;
    cin >> s;
    if (s == "Tetrahedron")
      ans += 4;
    else if (s == "Cube")
      ans += 6;
    else if (s == "Octahedron")
      ans += 8;
    else if (s == "Dodecahedron")
      ans += 12;
    else if (s == "Icosahedron")
      ans += 20;
  }
  cout << ans << '\n';
}
int main() { anton(); }
