#include <bits/stdc++.h>
char a[200005][15];
int main() {
  long long n, q = 0, w = 0, e = 0, r = 0, t = 0, sum;
  scanf("%lld", &n);
  for (long long i = 0; i < n; i++) scanf("%s", a[i]);
  for (long long i = 0; i < n; i++) {
    switch (a[i][0]) {
      case 'T':
        q++;
        break;
      case 'C':
        w++;
        break;
      case 'O':
        e++;
        break;
      case 'D':
        r++;
        break;
      default:
        t++;
    }
  }
  sum = q * 4 + w * 6 + e * 8 + r * 12 + t * 20;
  printf("%lld", sum);
  return 0;
}
