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