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