#include <bits/stdc++.h>
using namespace std;
int func(string str) {
  if (str == "Tetrahedron") {
    return 4;
  } else if (str == "Cube") {
    return 6;
  } else if (str == "Octahedron") {
    return 8;
  } else if (str == "Dodecahedron") {
    return 12;
  } else if (str == "Icosahedron") {
    return 20;
  }
}
int main() {
  long long int n, count = 0;
  cin >> n;
  string str;
  while (n--) {
    cin >> str;
    count += func(str);
  }
  cout << count << endl;
  return 0;
}
