#include <bits/stdc++.h>
int main() {
  int n, faces = 0;
  char s[100];
  scanf("%d", &n);
  while (n--) {
    scanf("%s", s);
    if (strcmp(s, "Cube") == 0)
      faces += 6;
    else if (strcmp(s, "Tetrahedron") == 0)
      faces += 4;
    else if (strcmp(s, "Octahedron") == 0)
      faces += 8;
    else if (strcmp(s, "Dodecahedron") == 0)
      faces += 12;
    else
      faces += 20;
  }
  printf("%d", faces);
}
