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