#include <bits/stdc++.h>
int main() {
  int num;
  scanf("%d", &num);
  int res = 0;
  for (int i = 0; i < num; i++) {
    char shape[30];
    scanf("%s", shape);
    switch (shape[0]) {
      case 'T':
        res += 4;
        break;
      case 'C':
        res += 6;
        break;
      case 'O':
        res += 8;
        break;
      case 'D':
        res += 12;
        break;
      case 'I':
        res += 20;
        break;
    }
  }
  printf("%d\n", res);
  return 0;
}
