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