#include <bits/stdc++.h>
int main() {
  int a, k, b, i, n, j, sum = 0, w, t;
  char ch, p, x;
  float g, h;
  char s[100001], ara[3352];
  scanf("%d\n", &t);
  for (i = 1; i <= t; i++) {
    scanf("%s", s);
    if (s[0] == 'T')
      sum = sum + 4;
    else if (s[0] == 'C')
      sum = sum + 6;
    else if (s[0] == 'I')
      sum = sum + 20;
    else if (s[0] == 'O')
      sum = sum + 8;
    else if (s[0] == 'D')
      sum = sum + 12;
  }
  printf("%d\n", sum);
  return 0;
}
