#include <bits/stdc++.h>
int main() {
  int n, m, i, k, t;
  char s[50];
  scanf("%d", &n);
  t = 0;
  for (i = 1; i <= n; i++) {
    scanf("%s", &s);
    if (s[0] == 'D') t += 12;
    if (s[0] == 'C') t += 6;
    if (s[0] == 'T') t += 4;
    if (s[0] == 'I') t += 20;
    if (s[0] == 'O') t += 8;
  }
  printf("%d\n", t);
}
