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