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