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