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