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