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