#include <bits/stdc++.h>
int main() {
  char str[100];
  int i, n, sum = 0, count;
  scanf("%d ", &n);
  for (i = 1; i <= n; i++) {
    gets(str);
    if (strcmp(str, "Tetrahedron") == 0)
      count = 4;
    else if (strcmp(str, "Cube") == 0)
      count = 6;
    else if (strcmp(str, "Octahedron") == 0)
      count = 8;
    else if (strcmp(str, "Dodecahedron") == 0)
      count = 12;
    else if (strcmp(str, "Icosahedron") == 0) {
      count = 20;
    }
    sum = sum + count;
  }
  printf("%d\n", sum);
  return 0;
}
