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