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