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