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