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