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