#include <bits/stdc++.h>
using namespace std;
int i, j, k, n, m, v[1001], ok = 0;
char p[1001], o[1001], l, qs, ss;
int main() {
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> p;
    if (p[0] == 'T') ok += 4;
    if (p[0] == 'C') ok += 6;
    if (p[0] == 'O') ok += 8;
    if (p[0] == 'D') ok += 12;
    if (p[0] == 'I') ok += 20;
  }
  cout << ok;
  return 0;
}
