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