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