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