#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  string poly;
  int count = 0;
  while (n--) {
    cin >> poly;
    if (poly == "Tetrahedron")
      count += 4;
    else if (poly == "Cube")
      count += 6;
    else if (poly == "Octahedron")
      count += 8;
    else if (poly == "Dodecahedron")
      count += 12;
    else if (poly == "Icosahedron")
      count += 20;
  }
  printf("%d\n", count);
  return 0;
}
