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