#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  unsigned int n, faces_sum = 0;
  string buffer;
  cin >> n;
  for (unsigned int i = 0; i <= n; i++) {
    getline(cin, buffer);
    if (buffer == "Tetrahedron") {
      faces_sum += 4;
    } else if (buffer == "Cube") {
      faces_sum += 6;
    } else if (buffer == "Octahedron") {
      faces_sum += 8;
    } else if (buffer == "Dodecahedron") {
      faces_sum += 12;
    } else if (buffer == "Icosahedron") {
      faces_sum += 20;
    }
    buffer.clear();
  }
  cout << faces_sum;
  return 0;
}
