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